![]() ![]() The ID of the control which causes the postback is stored in the _EVENTTARGET hidden field, so you can find the control which caused the postback. After this, the page is submitted back to the server. I have a simple asp.net page with an asp.net link button and asp.net content tag which point to a simple asp.net master page with an asp.net content place holder and a form tag. If we inspect the code of the _doPostBack function, we can see that it first sets the values of two hidden fields with the two parameters passed to the function. The two hidden variables can be accessed from the code behind using the forms or params collection. The value of the parameters eventTarget and eventArgument are stored in the hidden fields. The ID of the control which causes the postback is stored in the EVENTTARGET hidden field, so you can find the control which. After this, the page is submitted back to the server. ![]() When a page is posted back to the server ASP.NET inspects _EVENTTARGET and _EVENTARGUMENT values and this way it can decide which of the controls caused the page to be posted back and what is the event that has to be handled. If we inspect the code of the doPostBack function, we can see that it first sets the values of two hidden fields with the two parameters passed to the function. You can see the doPostBack () function will get automatically added to the page output. To know this, drag a LinkButton control into the page and execute the page. In any ASP.NET page the two hidden fields: _EVENTTARGET and _EVENTARGUMENT are automatically declared. ASP.Net runtime will automatically insert the definition of doPostBack () function in the HTML output when there is a control that can initiate a postback in the page. ![]() The function takes the following two arguments:ĮventTarget - This contains the ID of the control that caused the post back.ĮventArgument - This contains any additional data associated with the control. You can see this _doPostBack function in your ASP.NET generated HTML code. Today I am going to talk about the _doPostBack function, because there is some confusion with using this function. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |