<%@ Page Title="custom validation example" Language="C#" MasterPageFile="~/RoseindiaMaster.master"
AutoEventWireup="true" CodeFile="CustomValidator.aspx.cs"
Inherits="CustomValidator" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language="javascript" type="text/javascript">
function JSValidate(source, args) {
var element = document.getElementById('<%=usernameTextBox.ClientID %>');
if (element.value.length >= 6 && element.value.length <=15)
{
args.IsValid = true;
}
else {
args.IsValid = false;
}
}
</script>
<style type="text/css">
.style2
{
font-size: small;
font-family: Verdana;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>
AutoEventWireup="true" CodeFile="CustomValidator.aspx.cs"
Inherits="CustomValidator" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language="javascript" type="text/javascript">
function JSValidate(source, args) {
var element = document.getElementById('<%=usernameTextBox.ClientID %>');
if (element.value.length >= 6 && element.value.length <=15)
{
args.IsValid = true;
}
else {
args.IsValid = false;
}
}
</script>
<style type="text/css">
.style2
{
font-size: small;
font-family: Verdana;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>
No comments:
Post a Comment