question regarding __doPostBack

Discussion in 'ASP .Net' started by Marcelo, Dec 11, 2004.

  1. Marcelo

    Marcelo Guest

    Hello,
    I am trying to create a postback event, and it is working, just not calling
    the sub.
    I have a datagrid which has
    <asp:DataGrid id="Mensajes"
    ...
    <Columns>
    <asp:HyperLinkColumn
    ....

    DataNavigateUrlFormatString="javascript:__doPostBack('loadMessage','{0}')"

    I also placed the following javascript function:
    function __doPostBack(eventTarget, eventArgument) {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("netscape")
    > -1) {

    theform = document.forms["_ctl0"];
    }
    else {
    theform = document._ctl0;
    }
    theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    theform.__EVENTARGUMENT.value = eventArgument;
    theform.submit();
    }


    In the Sub Page_Load
    I have
    response.write ("__EVENTTARGET " & request("__EVENTTARGET") & "<br>")
    response.write ("__EVENTARGUMENT " & request("__EVENTARGUMENT") & "<br>")

    and I do receive both parameters, but the sub 'loadMessage' never gets
    called.
    Right now I patched it using a switch/case __EVENTTARGET then calling the
    sub "manually".

    What did I miss?

    Thanks
    Marcelo, Dec 11, 2004
    #1
    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. paul reed

    Wierd Behavior of __doPostBack

    paul reed, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    539
    Bassel Tabbara [MSFT]
    Jul 8, 2003
  2. Mike Dunn

    Overriding __doPostBack

    Mike Dunn, Jul 9, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    860
    vMike
    Jul 9, 2003
  3. Hayato Iriumi

    __doPostBack EventArgument

    Hayato Iriumi, Jul 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    713
    Hayato Iriumi
    Jul 22, 2003
  4. E
    Replies:
    3
    Views:
    4,199
    John Saunders
    Jul 31, 2003
  5. GaryDean

    __doPostBack Arguments question

    GaryDean, Apr 9, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    6,799
    Steven Cheng[MSFT]
    Apr 12, 2006
Loading...

Share This Page