Linkbutton is not doing Postback

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NewAjaxDevloper
    New Member
    • Sep 2010
    • 1

    Linkbutton is not doing Postback

    I have 2 link button in my page and every thing was working fine until i added window.onload() method on my page.

    After adding window.onload() first link button is working but not the second button. I am using update panel in my page


    Please help me

    Code:
    <script>
    function PageTest() { //do some task}
    
    window.onload = PageTest;
    
    </script>
    
    <asp:UpdatePanel ID="UpdPanel" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="linkbutton1" EventName="Click" />
                </Triggers>
                <ContentTemplate>  
      //some code
                    <asp:linkbutton id="linkbutton1" runat="server" cssclass="btn" onclick="linkbutton1_Click" OnClientClick ="return Ischecked('abc');">
                </ContentTemplate>
            </asp:UpdatePanel>
                    
            <asp:UpdatePanel ID="UpdatePanel1" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="linkbutton1" EventName="Click" />
                </Triggers>
                <ContentTemplate>
                    <asp:placeholder id="placeholder" visible="false" runat="server">
                    <asp:linkbutton id="linkbutton2" runat="server" cssclass="btn" onclick="linkbutton2_Click" OnClientClick="return IsChkBoxchecked('xyz')" >
                    <span>Submit</span>
                    </asp:linkbutton>
                                
                    </asp:placeholder>
                </ContentTemplate>
            </asp:UpdatePanel>
    Last edited by Frinavale; Sep 23 '10, 07:44 PM. Reason: End [/code] tag added
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Looks like you posted code but removed the problematic sections ;)

    Is there something wrong with your JavaScript method that might be causing the problem?

    Have you tried using JavaScript debugger tools (like the ones that come built into IE8 or using FireBug for FireFox)?

    -Frinny

    Comment

    • ZiadElmalki
      New Member
      • Sep 2010
      • 43

      #3
      Does the event handler work when the page gets posted back eventually. Looks like the AsyncPostBackTr igger both say linkbutton1

      Comment

      Working...