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

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

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

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. ken busse
    Replies:
    2
    Views:
    537
  2. Guadala Harry
    Replies:
    4
    Views:
    1,727
    =?Utf-8?B?aGFyaSBwcmFzYWQ=?=
    Jun 15, 2004
  3. =?Utf-8?B?bGFuZW0=?=
    Replies:
    3
    Views:
    29,577
    Eliyahu Goldin
    Mar 30, 2005
  4. Boss302
    Replies:
    0
    Views:
    1,324
    Boss302
    Nov 21, 2006
  5. Vili
    Replies:
    5
    Views:
    562
    siccolo
    Feb 19, 2008
  6. Simon
    Replies:
    5
    Views:
    999
    Steven Cheng [MSFT]
    Apr 30, 2008
  7. Bogdan
    Replies:
    2
    Views:
    846
    Bogdan
    Jun 9, 2008
  8. Zoe Hart
    Replies:
    1
    Views:
    584
    Scott Wisniewski
    Jan 8, 2004
Loading...