views:

30

answers:

1

The reason I want to know this is because it seems that __doPostBack('controlId','eventarg') raises the unique event of the control specified, but I wonder what would happen if the control had multiple unique events.

+2  A: 

It actually causes a call to the RaisePostBackEvent method which the control exposes through the IPostBackEventHandler interface. The control can then check the argument and raise an appropriate event. Some controls will ignore the argument and just raise Click, but on GridView it could trigger events like PageIndexChanging, Sorting, or SelectedIndexChanging.

stevemegson
Thanks. If one wanted to trigger a GridView PageIndexChanging event w/ a doPostBack call, would one pass in as the argument 'PageIndexChanging', or is it more complicated than that?
GridView uses arguments like `Page$3` to change page or `Delete$0` to delete the first row. You can find the arguments by checking that doPostBack calls that the GridView generates itself, though officially they're implementation details that could change without warning in future versions.
stevemegson
Great. Thanks again.