Accessing controls located in LoginView

May 4, 2009 PGS Team

Tags:ASPX

Everyday battle has just started 🙂

Morning problem:

<asp:LoginView runat="server">
  </AnonymousTemplate>
  --something--
  </AnonymousTemplate>
  <LoggedInTemplate>
    <asp:TextBox ID="magicTextBox" runat="server" />
  </LoggedInTemplate>
</asp:LoginView>

Does anyone know how to access control named magicTextBox from code behind? Of course referencing it by name or using FindControl method was unsuccessful. I have just used temporal solution with JavaScript. When I find something valuable I will let you know.

Last posts