Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Triggering a button click goes to page load and not to the button handler ...

$
0
0

I have the following code in my ASPx Page:

    <asp:ScriptManager ID="scrAjaxScript" runat="server"></asp:ScriptManager>

    <script language="javascript" type="text/javascript">
      function ProfileSearch_CallBack(strProfileName, strProfileId)
      {
           __doPostBack("<%=button.ClientID %>","");
      }
    </script>

   <asp:Button ID="button" runat="server" OnClick="button_Click" style="display:none;"/>

<asp:UpdatePanel runat="server" ID="upPnlEGridPanel" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="button" EventName="Click" />
            </Triggers>
       <ContentTemplate>

...

</ContentTemplate>
</Asp:UpdatePanel>

When 'ProfileSearch_CallBack' is called, it does a partial postback but instead of going to the button handler it just ends up in Page_Load. But in the headers I do see ASyncpost=true.

Where and what I am messing up here?


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>