单击按钮时避免页面加载 [英] Avoid page load on click of a button

查看:59
本文介绍了单击按钮时避免页面加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个网格,在点击按钮后会被绑定。我想避免按钮上的页面加载事件单击你jquery。请帮助我。



谢谢....

Hi,
I am having a grid which wil be binded aftr the button is clicked. I want to avoid the page load event on the button click you jquery. Pleae help me on this.

Thanks....

推荐答案

页面加载事件将始终触发回帖如果你不想执行代码



把我放进去!isPostBack条件



Page load event will always fire on postback if you dont want to execute the code

put i in !isPostBack Condition

if (!isPostBack)

{

//Place the code here

}


If Not Page.IsPostBack Then
                btnAddSub.Visible = False
               
            End If


在这种情况下,你需要使用jquery / Javascript.Without javascript,只要你点击你的按钮,PageLoad就会被解雇。



另一种情况是,如果你没有任何代码w在PageLoad上然后在.aspx页面的页面指令中设置AutoEventWireup =False。通过设置此属性,不会调用此函数。
In this case you need to use jquery/Javascript.Without javascript whenever you click on your button PageLoad will be Fired.

another scenario is if you don't have any code written on the PageLoad then Set the AutoEventWireup="False" in page directive of .aspx page.By setting this property this function will not be called.


这篇关于单击按钮时避免页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆