Sowmya Sirsi

Sowmya Sirsi

  • NA
  • 173
  • 45.4k

The server tag is not well formed.

May 14 2021 1:22 PM
Hi Team, Once I execute this code I am getting an error  on the highlighted line "The server tag is not well formed".
I also tired using <table id= "tbllogin" runat="server"> </table> then I get a on 
<% if (tbllogin.Visible == true)
{ %>  saying "object reference not set to an instance of an object."
 
Please do the needfull 
====================== 
<% if (tbllogin.Visible == true)
{ %>
<asp:Table id="tbllogin" runat="server" cellpadding="0"cellspacing="5" border="0" width="450" align="center">
<asp:TableRow>
<asp:TableCell width="152" class="text-login">User Name</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtUserName" runat="server"
CssClass="login-field" TabIndex="1"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequiredField" runat="server" ControlToValidate="txtUserName"
CssClass="Message" Display="None" ErrorMessage="Please enter User Name"></asp:RequiredFieldValidator>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell class="text-login">Password</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtuserPwd" runat="server" BorderStyle="Outset" CssClass="login-field"
TextMode="Password" TabIndex="2"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordFieldValidator" runat="server" ControlToValidate="txtuserPwd"
CssClass="Message" Display="None" ErrorMessage="Please enter Password"></asp:RequiredFieldValidator>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell>
<asp:Button ID="btnUserAuth" runat="server" CssClass="btn-login" OnClick="btnUserAuth_Click"
Text="Login" />
<%-- <asp:Button ID="btnUserAuth" runat="server" CssClass="btn-login" NavigateUrl="OTP.aspx" Text="Login" />
--%> <p> <asp:HyperLink ID="hyperLink1" runat="server" CssClass="txt-frgt-pswd" NavigateUrl="PasswordRecoverySearch.aspx"
Target="_parent">Forgot your password?</asp:HyperLink></p>
<asp:ValidationSummary ID="LoginValidationSummary" runat="server"
CssClass="msg-red" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell>
<asp:Label ID="lblSuccess" runat="server" CssClass="msg-green" Visible="false"></asp:Label>
<asp:Label ID="lblFailure" runat="server" CssClass="msg-red" Visible="false"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblMessage" runat="server" CssClass="msg-red" meta:resourcekey="lblMessageResource1"></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
<% } %>
<% else
{ %>
<div class="login-field-wrapper" runat="server">
<asp:Table id="tblotp" runat="server" cellpadding="0"cellspacing="5" border="0" width="450" align="center">
<asp:TableRow>
<asp:TableCell>
<h4>
<span class="login-heading" style="text-align:center">OTP</span>
<asp:Label Style="margin-left: 20px" runat="server" ID="lblotpsent" Visible="False" Font-Italic="True" ForeColor="#009900"></asp:Label>
</h4>
</asp:TableCell>
<asp:TableCell width="152" class="text-login">Enter the OTP</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="TextBox1" runat="server" CssClass="login-field" TabIndex="1" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
CssClass="Message" Display="None" ErrorMessage="Please enter OTP"></asp:RequiredFieldValidator>
</asp:TableCell>
<asp:TableCell>
<asp:Button ID="Button2" runat="server" CssClass="btn-login" OnClick="btnotpsubmit_Click"
Text="Submit" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
<% } %>
<div class="login-footer">

Answers (4)