I am implementing a one time password with google authenticator for login page. After checking the user id and password is correct, I need to hidden the login box and show the QR code, OTP textbox and submit button. I saw sample using Panel.visible = true/false to switch. It is work in Page_Load to set default Panel_GoogleAuth.visible = false, but it is not work in the login button onClick event. It can't show the Panel_GoogleAuth and just hidden the login button but not the whole Panel_Login. Does anyone know why?
My reference: Sample
aspx:
<asp:Panel ID="Panel_GoogleAuth" runat="server" Font-Names="Arial" Font-Size="12pt" HorizontalAlign="Center" Width="1024px">
<div class="row">
<div class="col-3"></div>
<div class="col-5">
<fieldset class="TOTP">
<asp:Label ID="lblScanQRCode" runat="server" Style="padding-top: 4px">Sceen the QR Code in Google Authenticator</asp:Label>
<br />
<asp:Image ID="imgQRCode" runat="server" Width="200" Height="200" />
<asp:HiddenField ID="hfSecretKey" runat="server" />
<br />
<asp:TextBox ID="txtOTP" runat="server" placeholder="Enter One-Time-Password"></asp:TextBox>
<asp:Button ID="btnVerify" runat="server"Text="Verify OTP" />
<br /><br />
<asp:Label ID="lblMessage" runat="server"></asp:Label>
</fieldset>
</div>
</div>
</asp:Panel>
<telerik:RadAjaxPanel ID="StaffPanel" runat="server" Width="99%">
<div id="wrap-content">
<asp:Panel ID="Panel_Login" runat="server" Font-Names="Arial" Font-Size="12pt" HorizontalAlign="Center" Width="1024px">
<asp:Login ID="LoginUser" Class="Login" runat="server" EnableViewState="false" RenderOuterTable="false">
<div class="accountInfo">
<div class="row">
<div>
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Staff ID:</asp:Label>
</div>
<div>
<asp:TextBox ID="UserName" runat="server" CssClass="textEntry" Width="114%" Height="20"></asp:TextBox>
</div>
</div>
<div class="row">
<div>
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" Style="padding-top: 4px">Password</asp:Label>
</div>
<div>
<asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password" Width="114%" Height="20"></asp:TextBox>
</div>
</div>
<div class="row">
<telerik:RadButton ID="btnLogin" runat="server" Text="Login" OnClick="RadButton_LoginCheck_Click" RenderMode="Lightweight" Width="93%" Font-Size="X-Large" Skin="Silk" Height="35px" Font-Names="Arial"></telerik:RadButton>
</div>
</div>
</asp:Login>
</asp:Panel>
</div>
</telerik:RadAjaxPanel>
aspx.vb:
Protected Sub btnLogin_Click(sender As Object, e As System.EventArgs) Handles btnLogin.Click If staffIDRegex.Match(checkStaffId).Success Then Panel_Login.Visible = False Panel_GoogleAuth.Visible = True End If End Sub