自己写的一个资料验证的asp.net程序,大家看看吧!

转载 2008年05月01日 03:33:00
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!-------资料验证:天乐comezxn@sina.com------------>
<!-------比较简单,以前写的,若有纰漏,请跟我联系---------->
<Html>
<Body bgcolor="White">
<H3>Validator(资料验证)控制元件<Hr></H3>

<Form runat="server">
<Blockquote>

Email:<asp:TextBox id="Email" runat="server"/>

<asp:RegularExpressionValidator id="Valid1" runat="server"
ControlToValidate="Email"
ValidationExpression=".{1,}@.{3,}" >
(Email 应含有@号)
</asp:RegularExpressionValidator><p>

您的电话:<asp:TextBox id="Tel" runat="server"/>

<asp:RegularExpressionValidator id="Valid2" runat="server"
ControlToValidate="Tel"
ValidationExpression="/([0-9]{2,3}/)[0-9]{2,4}-[0-9]{4}" >
(区号)您的电话
</asp:RegularExpressionValidator><p>


您的地址:<asp:TextBox Size=60 id="Addr" runat="server"/>
<!--------仿照了王国荣的《asp.net领先研究》的程序------------>
<asp:RegularExpressionValidator id="Valid3" runat="server"
ControlToValidate="Addr"
ValidationExpression="(.{1,}(市|镇|乡).{1,}(路|街|道).{1,}号.{0,})|(.{1,}邮政.{1,}信箱)" >
(必须含有 '市镇乡'、'路街道'、'号' 或 '邮政'、信箱')
</asp:RegularExpressionValidator><p>

<asp:Button id="Button1" Text=" 输入 " runat="server"
OnClick="Button1_Click" />
<asp:Label id="Label1" runat="server"/>

</Blockquote></form>
<Hr></body>
</html>

<script Language="c#" runat="server">
public void Button1_Click (object sender, System.EventArgs e)
{
If(Page.IsValid) {
  Label1.Text = "<p><Font Color=Red>资料验证 OK!</Font>"
  Button1.Visible = False
  }
}
</
11AJ1D012042640.jpg
seover="window.status='正文--自己写一个资料验证asp.net程序大家看看吧!';return true">
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
收藏助手
不良信息举报
您举报文章:自己写的一个资料验证的asp.net程序,大家看看吧!
举报原因:
原因补充:

(最多只允许输入30个字)