Ajax Post URL 在 ASP.net Image Button OnClientClick 上不起作用。我想通过 OnClientClick 中的 Ajax Post URL 获取值。
<asp:ImageButton ID="btngo" runat="server" ImageUrl="~/oea_images/login_btn.png"
OnClick="btngo_Click" OnClientClick="clean_all();" Width="80px" />
function clean_all() {
try {
alert("enter");
$.ajax({
type: "POST",
url: "WebForm9.aspx/ForceOut",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msgs) {
//alert(msgs);
//alert(msgs.d);
if (msgs.d == "out") {
alert("check");
}
}
});
} catch (ex) {
alert(ex.Message);
}
}