![]() 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. Certified Pre-Owned Center: 1845 E Main St. St Charles Toyota: 2651 E Main St Saint Charles, IL 60174. 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. Our knowledgeable St Charles Toyota new car dealer staff is dedicated and will work with you. The two hidden variables can be accessed from the code behind using the forms or params collection. Let’s check up on the code fences below to. Later, with the second argument, we will explain any necessary message or action referred to after a valid post. These arguments allow identifying the event that will cause the post method to get fired. The value of the parameters eventTarget and eventArgument are stored in the hidden fields. The dopostback () function of JavaScript takes two parameters, EventTarget and EventArgument. ![]() 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. In any ASP.NET page the two hidden fields: _EVENTTARGET and _EVENTARGUMENT are automatically declared. 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 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. You can see this _doPostBack function in your ASP.NET generated HTML code. 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. 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 |