The original Published time: 2008-07-29--from my Baidu article [imported by moving tools]
Using System;
Using System.Data;
Using System.Configuration;
Using System.Collections;
Using System.Web;
Using System.Web.Security;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.WebControls.WebParts;
Using System.Web.UI.HtmlControls;
public partial class Default4:System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
}
protected void Button1_Click (object sender, EventArgs e)
{
}
protected void Button1_click1 (object sender, EventArgs e)
{
if (page.isvalid)
{
Label1.Text = "Pass";
}
Else
{
Label1.Text = "fail";
}
}
protected void Txtvlue (object source, ServerValidateEventArgs args)
{
if (args. Value = = "Server Side")
{
Args. IsValid = true;
}
Else
{
Args. IsValid = false;
}
}
}
--------------------------------------
<title> Untitled Page </title>
<script type= "Text/javascript" >
function Txtvalue (s,e)
{
if (e.value== "client")
{
E.isvalid=true;
}
Else
{
E.isvalid=false;
}
}
</script>
<body>
NET5: Custom validation Controls server-side validation and use of client authentication