仰天一笑(Ansonxuyu),专业从事软件定制开发、Web软件开发,网站建设,网络推广,APP开发,微博应用开发,微信应用开发,电子商务开发,物联网开发等技术。
互联网8年风雨,愿在此交朋识友,交流心得,分享技术知识(策划/研发/运营/推广/合作)!QQ:943530498


仰天一笑

昨日不悔,今日勿失,明日莫忧! —徐羽

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
我们现在要做一个杂志订阅系统,要用户输入Email,输入两次密码,密码要一样,密码要求安全,所以必须包括(!@#$%^&*+;:),输入用户的电话,最长20位,必须选择信用卡,输入卡号,卡号为15位,程序如下,好简单的,大家看看。

<%
 public sub OnSubmit(source as Object, e as EventArgs)
  if Page.IsValid then
   "数据入库等操作
  end if
 end sub
%>
<h3><font face="Verdana">订阅时尚生活杂志</font></h3>
<form runat=server>
 <hr width=600 size=1 noshade>
 <center>
 <asp:ValidationSummary ID="valSum" runat="server"
    HeaderText="您必须填写完整所有的选项"
    DisplayMode="SingleParagraph"
    Font-Name="verdana"
    Font-Size="12"
 />
 <p>


 <!-- sign-in -->
 <table border=0 width=600>
  <tr><td colspan=3>
  <table border=0 cellpadding=0 cellspacing=0 width="100%">
   <tr><td>
 <font face=geneva,arial size=-1><b>Sign-In Information</b>
 </font>
   </td></tr>
  </table>
  </td></tr>
    <tr>
    <td align=right>
     <font face=Arial size=2>输入您的Email</font>
               </td>
    <td>
   <asp:TextBox id=email width=200px maxlength=60 runat=server />
    </td>
    <td>
     <asp:RequiredFieldValidator id="emailReqVal"
        ControlToValidate="email"
        ErrorMessage="您的Email. "
        Display="Dynamic"
        Font-Name="Verdana" Font-Size="12"
        runat=server>
        *
     </asp:RequiredFieldValidator>
     <asp:RegularExpressionValidator id="emailRegexVal"
        ControlToValidate="email"
        Display="Static"
        ValidationExpression=
          "^[\w-]+@[\w-]+\.(com|net|org|edu|mil)$"
        Font-Name="Arial" Font-Size="11"
        runat=server>
     不是一个正确的Email 请输入一个正确的Email
     </asp:RegularExpressionValidator>
    </td>
   </tr>
   <tr>
    <td align=right>
     <font face=Arial size=2>密码:</font>
    </td>
    <td>
     <asp:TextBox id=passwd TextMode="password" maxlength=20
            runat=server/>
    </td>
    <td>
     <asp:RequiredFieldValidator id="passwdReqVal"
        ControlToValidate="passwd"
        ErrorMessage="密码. "
        Display="Dynamic"
        Font-Name="Verdana" Font-Size="12"
        runat=server>
        *
     </asp:RequiredFieldValidator>
     <asp:RegularExpressionValidator id="passwdRegexBal"
        ControlToValidate="passwd"
        ValidationExpression=".*[!@#$%^&*+;:].*"
        Display="Static"
        Font-Name="Arial" Font-Size="11"
        Width="100%" runat=server>
     密码必须包括下面中的一个 (!@#$%^&*+;:)
     </asp:RegularExpressionValidator>
    </td>
   </tr>
   <tr>
    <td align=right>
     <font face=Arial size=2>请再输入一次密码:</font>
    </td>
    <td>
     <asp:TextBox id=passwd2 TextMode="password" maxlength=20
        runat=server/>
    </td>
    <td>
     <asp:RequiredFieldValidator id="passwd2ReqVal"
        ControlToValidate="passwd2"
        ErrorMessage="再输入一次密码. "
        Display="Dynamic"
        Font-Name="Verdana" Font-Size="12"
        runat=server>
        *
     </asp:RequiredFieldValidator>
     <asp:CompareValidator id="CompareValidator1"
      ControlToValidate="passwd2" ControlToCompare="passwd"
      Display="Static"
      Font-Name="Arial" Font-Size="11"
      runat=server>
      两次输入的密码怎么不一样:)
     </asp:CompareValidator>
    </td>
   </tr>
    <tr><td colspan=3> </td></tr>
    <!-- personalization information -->
    <tr><td colspan=3>
     <table border=0 cellpadding=0 cellspacing=0 width="100%">
      <tr><td><font face=geneva,arial size=-1>
       <b>Personal Information</b></font>
      </td></tr>
     </table>
    </td></tr>
   <tr>
    <td align=right>
     <font face=Arial size=2>电话:</font>
   </td>
   <td>
    <asp:TextBox id="phone" maxlength=20 runat="server" />
   </td>
   <td>
    <asp:RequiredFieldValidator id="phoneReqVal"
      ControlToValidate="phone"
      ErrorMessage="Phone. "
      Display="Dynamic"
      Font-Name="Verdana" Font-Size="12"
      runat=server>
      *
    </asp:RequiredFieldValidator>
   </td>
  </tr>
  <tr><td colspan=3> </td></tr>


   <!-- Credit Card Info -->
  <tr>
   <td colspan=3>
   <font face=Arial size=2><b>Credit Card Information</b></font>
   </td>
  </tr>
  <tr>
   <td align=right>
    <font face=Arial size=2>Card Type:</font>
   </td>
   <td>
    <ASP:RadioButtonList id=ccType
       Font-Name="Arial" RepeatLayout="Flow" runat=server>
    <asp:ListItem>招商银行一卡通</asp:ListItem>
    <asp:ListItem>建设银行龙卡</asp:ListItem>
    </ASP:RadioButtonList>
   </td>
   <td>
    <asp:RequiredFieldValidator id="ccTypeReqVal"
                                         ControlToValidate="ccType"
       ErrorMessage="信用卡种类. "
       Display="Static"
       InitialValue=""
       Font-Name="Verdana" Font-Size="12"
       runat=server>
        *
    </asp:RequiredFieldValidator>
   </td>
  </tr>
  <tr>
   <td align=right>
    <font face=Arial size=2>Card Number:</font>
   </td>
   <td>
    <ASP:TextBox id=ccNum runat=server />
   </td>
   <td>
    <asp:RequiredFieldValidator id="ccNumReqVal"
       ControlToValidate="ccNum"
       ErrorMessage="信用卡号. "
       Display="Dynamic"
       Font-Name="Verdana" Font-Size="12"
       runat=server>
       *
    </asp:RequiredFieldValidator>
    <asp:RegularExpressionValidator id="ccNumCustVal"
       ControlToValidate="ccNum"
       Display="Static"
       ValidationExpression="^\d{15}$"
       Font-Name="Arial" Font-Size="11"
       runat=server>
    信用卡号错误
    </asp:RegularExpressionValidator>
   </td>
  </tr>
 </table>
 <p>
 <input runat="server" type=submit value="注册">
 <p>
</form>
</center>

posted on 2006-03-08 12:46  仰天一笑  阅读(349)  评论(1编辑  收藏  举报