doPostBack client-side function

  • Thread starter Thread starter Johno
  • Start date Start date
J

Johno

Whenever you drop a linkbutton on an ASP.NET web form,
the following script gets emitted:

function __doPostBack(eventTarget, eventArgument) {
var theform = document.Form1;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value =
eventArgument;
theform.submit();
}

However, when I check the call to __doPostBack() executed
when the linkbutton is checked, only the eventTarget
argument is specified, even though the linkbutton has
it's CommandArgument property set.

What's the purpose of the .__EVENTARGUMENT field in
relation to server-side postback controls?

TIA

John
 
__doPostBack is the generic asp.net generated function to cause postbacks.
Perhaps other controls that use it do have a reason to use the
__eventargument field.
 
For example controls that implement IPostBackEventHandler interface can send
arguments for postback processing. Some action might vary based on which
argument has been sent for the particular control. For example
implementation of Next/Prev buttons in a custom control.

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 
Back
Top