Javascript Postback Event
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.
}
}
精彩评论