<script language="javascript" type="text/javascript">
function Validate1()
{
if (document.getElementById('<%=txtUserName.ClientID %>').value == '') {
document.getElementById('<%=lblError1.ClientID %>').innerHTML = "Please Enter User Name";
return false;
}
else if(document.getElementById('<%=txtPassword.ClientID %>').value == '') {
document.getElementById('<%=lblError1.ClientID %>').innerHTML = "Please Enter Password";
return false;
}
}
</script>
<div>
<asp:Panel ID="pnllogin1" BorderColor="White" BorderStyle="Solid" runat="server">
<table>
<tr>
<td>
<asp:Label ID="lblEmail" Font-Size="Small" runat="server" Text="User Name"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtUserName" runat="server" EnableViewState="true"></asp:TextBox>
</td>
</tr>
<tr>
<td><asp:Label ID="lblPassword" Font-Size="Small" runat="server" Text="Password" EnableViewState="true"></asp:Label> </td>
<td>
<asp:TextBox ID="txtPassword" TextMode="Password" runat="server"></asp:TextBox> </td>
</tr>
<tr>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return Validate1();" onclick="LinkButton1_Click">Login</asp:LinkButton>
</td>
<td>
<asp:Label ID="lblError1" Font-Size="Small" runat="server" Text="lblmsg"></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
</div>
No comments:
Post a Comment