I do not think my question is new, but I tried many solutions on this website and nothing worked. So, here is my problem:
I have this code that giving me 2 errors about "password" and "username". I created the project as a website, so I do not have a design file to fix. How can I fix this?
Here is the code from aspx file:
<section id="loginForm">
<h2> </h2>
<asp:Login runat="server" ViewStateMode="Disabled" RenderOuterTable="false">
<LayoutTemplate>
<p class="validation-summary-errors">
</p>
<fieldset>
<legend>Log in Form</legend>
<ol>
<li>
<asp:Label runat="server" AssociatedControlID="UserName">User name</asp:Label>
<asp:TextBox runat="server" ID="UserName" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="UserName" CssClass="field-validation-error" ErrorMessage="The user name field is required." />
</li>
<li>
<asp:Label runat="server" AssociatedControlID="Password">Password</asp:Label>
<asp:TextBox runat="server" ID="Password" TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Password" CssClass="field-validation-error" ErrorMessage="The password field is required." />
</li>
<li>
</li>
</ol>
<asp:Button runat="server" CommandName="Login" Text="Log in" ID="Login" OnClick="Login_Click" Width="300px" />
</fieldset>
</LayoutTemplate>
</asp:Login>
<p>
</p>
</section>
Here is the code in aspx.cs file:
string UN = UserName.Text; //Request.QueryString["UserName"];
string PW = Password.Text;//Request.QueryString["Password"];