使用jQuery的调用方法 [英] Call method using jQuery
问题描述
你好朋友,
我是jQuery/
的新手
在我的asp.net页面上,我有
Hello friends,
I''m New to jQuery/
In my asp.net page I have
<asp:Button ID="btn" runat="server" Text="Button" OnClick="btn_Click"/>
protected void btn_Click(object sender, EventArgs e)
{
Response.Write(DateTime.Now.ToString());
}
并在jquery中
and in jquery
$(document).ready(function () {
$("#btn").click(function (e) {
e.preventDefault();
if (confirm("Hello World!!")) {
$("#btn").click();
}
});
});
如果用户在确认对话框中按是,我想发回邮件.
我该如何实施?
是的,我在上面的代码中做错了.
还是我有其他方法可以做到这一点?
致谢和问候
I want to make post back if user press yes on confirm dialog.
How can I implement this?
Yes I''m doing something wrong in the above code.
Or is there any other way I can accomplish this?
Thanks and Regards
推荐答案
(document).ready(function(){
(document).ready(function () {
( #btn").click(function(e){ e.preventDefault(); 如果(确认(" span>)){
("#btn").click(function (e) { e.preventDefault(); if (confirm("Hello World!!")) {
(" ) .点击(); } }); });
("#btn").click(); } }); });
如果用户在确认对话框中按是,我想发回邮件.
我该如何实施?
是的,我在上面的代码中做错了.
还是我有其他方法可以做到这一点?
谢谢与问候
I want to make post back if user press yes on confirm dialog.
How can I implement this?
Yes I''m doing something wrong in the above code.
Or is there any other way I can accomplish this?
Thanks and Regards
这篇关于使用jQuery的调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!