我不知道我是不是只是愚蠢但我不能在我的asp按钮onclick事件中得到血腥的Javascript :(
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" onclick="Javascript:returnConf();" />
我尝试过各种变体,包括:
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" onclick="<%= GetMyStupidCode() %>" />
但是编译器会继续把它作为它应该解释的代码或某些东西来挑选它并给我带来错误,例如:
Identifier expected
Invalid expression term )
Missing )
我输了,我怎么办?
提前致谢,
答案 0 :(得分:0)
只需写下
OnClientClick="return confirm('This will delete the user permanently. Are you sure?');"