开发者

Javascript Postback Event

开发者 https://www.devze.com 2022-12-09 22:02 出处:网络
I have a user control that is supposed to write a value to a hidden field every time the consuming page posts back.

I have a user control that is supposed to write a value to a hidden field every time the consuming page posts back.

Is there any way to trap the postback event at the page level? Perhaps I can wire up an event so that I 开发者_JAVA百科can run a function every time the page posts back.


You can determine within Page_Load whether an operation is the result of a postback (i'm assuming this is what you mean by "trapping the postback event at the page level".

protected void Page_Load(object sender, EventArgs e)
{
    if (Page.IsPostback)
    {
       //Your code here.

    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消