<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> untitled page </title>
<Script language = JavaScript>
Function check ()
...{
/** // Note the Regular Expression in javascript:/representation/
VaR Rg =/^ [w-] + (. [w-] +) * @ [w-] + (. [w-] +) + $ /;
If (document. getelementbyid ("txtid"). value = "000 ")
...{
Alert ("can't be 000 ");
Document. All ("txtid"). Focus ();
Return false;
}
VaR STR = Document. getelementbyid ("txtmail"). value;
If (! RG. Test (STR ))
...{
Alert ("email addess Error !! ");
Document. All ("txtmail"). Focus ();
Return false;
}
Else
...{
Return true;
}
}
</SCRIPT>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Asp: textbox id = "txtmail" runat = "server" style = "Left: 270px; position: relative;
Top: 221px "> </ASP: textbox>;
<! -- Notes: "onclientclick" and "onclick" the use of the 'return '-->
<Asp: button id = "btulogin" onclientclick = "Return check ()" runat = "server" style = "Left: 211px; position: relative; top: 289px"
TEXT = "button" onclick = "btulogin_click"/>
<Asp: textbox id = "txtid" runat = "server" style = "Left: 48px; position: relative;
Top: 159px "> </ASP: textbox> & nbsp;
</Form>
</Body>
</Html>