This is my script for validation in my project....
<script language="javascript" type="text/javascript">
function validate()
{
var username=document.getElementById("Txt_UserName").value;
var password=document.getElementById("Txt_Password").value;
if(username=="")
{
alert("Enter Your UserName")
document.getElementById("Txt_UserName").focus()
return false;
}
if(password=="")
{
alert("Enter Your Password")
document.getElementById("Txt_Password").focus()
return false;
}
}
</script>
i called the script in the .aspx.cs like
Btn_login.Attributes.Add("OnClientClick", "return validate()");
is it correct or not?
can any tell this,is it correct or not