Monday, June 16, 2008

Accessing __doPostBack parameter from code behind

Whenever a ASPX page is post back __doPostBack (if its enabled)function is called back. The __doPostBack function contains two arguments, eventTarget and eventArgument. The eventTarget is the control which has invoked the call and the eventArgument is values passed along. Sometimes this "eventArgument" is required and it can be accessed as follows from the C# code behind file.

string passedArgument = Request.Params.Get("__EVENTARGUMENT");

Thanks.



--

No comments: