asp.nettwitter-bootstrappanels

ASP .NET Panels visible true/false working only after double clicking in breakpoint mode


I have a strange problem. There are two panels in my Page. On click of a button one becomes visible and other gets hidden. Following is my code.

     <asp:Panel ID="pnlIDProof" runat="server" Visible="true">
     ID Proof Panel markup here......
    </asp:Panel>

    <asp:Panel ID="pnlRegister" runat="server" Visible="false">
     Registration Panel markup here.....
    </asp:Panel>

   protected void btnIDCheck_Click(object sender, EventArgs e)
     {
        if (candidate.IsDuplicateIDProof())
            CallExist();
        else
            CallRegistration();
    }        


       protected void CallRegistration()
        {
            pnlIDProof.Visible = false;
            pnlRegister.Visible = true;
            Session["Candidate"] = candidate;
        }

My problem is even though the above code is getting executed, panel switching is not happening. Panel switching is happening only when I insert a breakpoint near CallRegistration() method and double click my button (Note that on single click it's not working). Strange thing is, without breakpoint any no.of times I click on the button, it's not happening. Not sure what could be the problem. I am using bootstrap 4.


Solution

  • After searching a lot, found out the problem. Both my Panels are inside an UpdatePanel, visible true/false is not working because there are some javascript errors in the page. I am debbuging my application in Chrome, when I tried debugging in Internet explorer javascipt errors popped up. After correcting the Javascipt errors, page works fine.