如何在页面加载中查找事件源 [英] how to find event source in Page load
问题描述
大家好
我有一个Web表单,上面有许多控件,如按钮,下拉列表,复选框,texboo,找出其中哪个控件导致了txes
为此,将autopostback属性设置为true.
如何找到引发回发的控件页面加载"事件.
在此先感谢
Hi All
I have a webform on which many controls such as button,dropdownlist,checkbox, texboo find out which control has intiaited the txes are there
for which autopostback property is set to true.
How can I find the control On page load event which has intiated the postback.
Thanks in Advance
推荐答案
您好
我认为您期望的是 http://stackoverflow.com/questions/1536930/get-submit-button- id [ ^ ].
Hi
I think you are expecting this http://stackoverflow.com/questions/1536930/get-submit-button-id[^].
一次检查我的代码
Hi,
check my code once
string g = Page.Request.Params.AllKeys[2].ToString();
在上面的代码中,您将获得控件名称,该控件用于控制引发的回发事件
如果"g" 值为" ASP.NET_SessionId "表示该页面不是回发
否则具有控件名称
最好的
In the above code you''ll get control name which control raised postback event
if "g" value is "ASP.NET_SessionId" means that page is not a postback
otherwise it has control name
All the Best
这篇关于如何在页面加载中查找事件源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!