Search code examples
javascriptc#asp.netdopostback

__doPostBack on event works only once


I have a hidden asp control that has a server event to it (valuechanged). I call the javascript __doPostBack method and as a parameter I send the id of the hidden control which makes it raise the valuechanged event after the Page_Load. It works fine for the first time, but the other times it posts back without raising the event. Is there anything I am missing here? Is it caching the postback?

EDIT:

The hidden field is in an updatepanel, so the __doPostBack doesn't refresh the whole page


Solution

  • Well silly me. It won't raise the valuechanged event if you call __doPostBack on a control that its value remained the same! Oopsie...