Last post Dec 24, 2014 01:26 AM by Summer - MSFT
Dec 23, 2014 04:25 PM|markthornton90|LINK
Hi all, I am new to ASP.NET/C# and I am making a basic website for a University assignment.
I have an ASP.NET login control and ASP.NET CreateUserWizard control on the same page.
Both of these controls have been converted to templates and each one has it's own panel. When a user starts typing in the text boxes in one panel I would like the other panel to become visible = false.
How can I achieve this in c#?
Dec 23, 2014 11:31 PM|A2H|LINK
You can use the Textbox control's TextChanged event to handle this requirement like given below
<asp:Panel ID="Panel1" runat="server" Visible="false">
<%--Your control here--%>
<asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged" AutoPostBack="true"></asp:TextBox>
protected void TextBox1_TextChanged(object sender, EventArgs e)
Panel1.Visible = true;
Dec 24, 2014 01:26 AM|Summer - MSFT|LINK
Welcome to the ASP.NET forum.
Based on my understanding, you could hide the panel two then the TextBox get focus.
And add the onfocus event
to the TextBox.
<asp:TextBox ID="TextBox1" runat="server" onfocus="HidePanel()"></asp:TextBox>