删除page_load中的check_change事件 [英] remove check_change event in page_load

查看:87
本文介绍了删除page_load中的check_change事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个带有检查更改事件的复选框.每当我更改支票时,都会触发check_changed事件.

之后,如果我重新加载页面,它会自动调用check_changed事件.

我想知道如何摆脱page_load中的check_change事件.

如果需要,我会再次说明.

在此先感谢.

Hello,

I have an checkbox with check changed event. Whenever i change the chech it fires the check_changed event.

After that if i reload the page, its automatically calls the check_changed event.

I want to know how to get rid of this check_change event in page_load.

If needed, i will explain again.

Thanks in Advance.

推荐答案


检查此
Hi ,
Check this
protected void Page_Load(object sender, EventArgs e)
{
     CheckBox1.CheckedChanged -=new EventHandler(CheckBox1_CheckedChanged);
}



最好的问候
M.Mitwalli



Best Regards
M.Mitwalli


添加此方法

Add this method

public  RestartPage()
    {
    Response.Redirect(Request.Url.PathAndQuery)
}


在复选框事件或您想要的任何事件之后调用它.

请点击此链接获取更多信息
http ://forums.asp.net/p/1842974/5143995.aspx/1?Re + remove + check_change + event + in + page_load [


call it after checkbox event or any event u want.

follow this link for more info
http://forums.asp.net/p/1842974/5143995.aspx/1?Re+remove+check_change+event+in+page_load[^]




刷新是什么意思?如果在触发check_changed 事件后按"F5"clicked Reload ,则"F5"将立即发回prevoius请求的操作.这就是为什么该事件再次触发,因为该事件是上一个HttpRequest的直接响应.

希望对您有所帮助.
Hi,

What do you mean by refresh ? if you press "F5" or clicked Reload after the check_changed event been fired, then "F5" will make the operation requested by immediate prevoius post back. That is why, the event is firing again since that was immediate previous HttpRequest.

hope it helps.


这篇关于删除page_load中的check_change事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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