I have just started creating a new Web application using ASP.NET WebForms (VS 2012). In the project I have a Login.aspx page with a TextBox (created automatically by VS):
<asp:TextBox ID="Username" runat="server"></asp:TextBox>
Now I need to access the value of that text box, and I am using the following:
String username = Html.Encode(Username.Text);
I get an error, stating that Username does not exist. In Login.Designer.cs the TextBox is not declared.
On the designer, when I select the text box it is identified in the Properties dropdown as:
Unnamed1.LayoutTemplate.Username
This is my first project in VS2012; I have not had this issue in VS2008 or earlier. Is there anything different here?