doPostBack client-side function

Discussion in 'ASP .Net' started by Johno, Jul 18, 2003.

  1. Johno

    Johno Guest

    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
     
    Johno, Jul 18, 2003
    #1
    1. Advertising

  2. Johno

    Marina Guest

    __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.

    "Johno" <> wrote in message
    news:001f01c34d47$6ab94790$...
    > 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
     
    Marina, Jul 18, 2003
    #2
    1. Advertising

  3. Johno

    Teemu Keiski Guest

    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


    "Johno" <> wrote in message
    news:001f01c34d47$6ab94790$...
    > 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
     
    Teemu Keiski, Jul 18, 2003
    #3
  4. Johno

    Johno Guest

    Thanks for the response guys

    John
     
    Johno, Jul 21, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2VzYXI=?=

    adding extra code to the doPostBack function

    =?Utf-8?B?Q2VzYXI=?=, Jun 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,534
    Craig Deelsnyder
    Jun 16, 2005
  2. Boss302
    Replies:
    0
    Views:
    1,097
    Boss302
    Nov 21, 2006
  3. Bogdan
    Replies:
    2
    Views:
    686
    Bogdan
    Jun 9, 2008
  4. Zoe Hart
    Replies:
    1
    Views:
    400
    Scott Wisniewski
    Jan 8, 2004
  5. Koi

    Error in doPostBack function for Calendar control

    Koi, Apr 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    288
Loading...

Share This Page