| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 725 人关注过本帖
标题:求助一点击事件
取消只看楼主 加入收藏
jamesxiaoyao
Rank: 1
等 级:新手上路
威 望:2
帖 子:173
专家分:0
注 册:2007-5-21
结帖率:100%
收藏
 问题点数:0 回复次数:0 
求助一点击事件
最近要帮一朋友做设计,用 DOT NET (vb)的
碰上一问题,我做的一个注册页面,但点击事件没有任何反应,也没有报错出现,现在想烦请高手,指教下是哪里的问题。
下面贴出代码:

<%@ Page Language="vb" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="vb" runat="server">
sub clear_click(sender as object, e as eventargs)
user_id.text = ""
user_password.text = ""
affirm_password.text = ""
user_name.text = ""
sex.selecteditem.value = "false"
bir_year.text = "19"
bir_month.selecteditem.value = "jan"
bir_day.selecteditem.value = "one"
paper_num.text = ""
user_email.text = ""
user_address.text = ""
messages.text = ""
end sub
sub enter_click(sender as object,e as eventargs)
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("../database/login.mdb"))
dim birthday as date
dim bir,strsql as string
strsql = "Insert Into user_info(user_id,user_password,user_name,sex,birthday,paper_sort,paper_num,user_email,user_address) Values('" & user_id.text & "' ,'" & user_password.text & "','" & user_name.text & "','" & sex.selecteditem.value & "',#" & birthday & "#,'" & paper_sort.selecteditem.text & "','" & paper_num.text & "','" & user_email.text & "','" & user_address.text & "')"
bir = bir_month.selecteditem.value & " " & bir_day.selecteditem.value & "," & bir_year.text
birthday = cdate(bir)
'response.Write(strsql)
dim cmd as new oledbcommand(strsql,conn)
conn.open()
cmd.ExecuteNonQuery()
conn.close()
messages.text="<font color='blue'>"+"成功注册"+"</font>"
end sub
</script>
<html>
<head>
<title>注册页面</title>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td scope="col"><table width="100%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr align="left" valign="middle" bgcolor="#CCFFFF">
<td colspan="3" scope="col"><table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="200" align="left" valign="middle" scope="col"><strong>请认真填写你的信息。</strong></td>
<td align="right" valign="middle" scope="col"><span class="style1">请注意:带有*号的项目为必填项目</span></td>
</tr>
</table></td>
</tr>
<tr>
<td width="105"><span class="style1">*</span><span class="style5" style="color: #3036A9">用户登录名:</span></td>
<td width="211" align="center"><asp:TextBox ID="user_id" TextMode="SingleLine" runat="server" />
<br>
<asp:Label ID="msg1" runat="server" /></td>
<td width="230"><span class="style5" style="color: #3036A9"> 用户名由a~z的英文字母 (不区分大小写)、 0~9的数字、点、减号或下划线组成,长度为4~18个字符,例如:kyzy_001。
<asp:RegularExpressionValidator ControlToValidate="user_id" Display="Dynamic" ErrorMessage="您的输入不正确,请输入正确的用户名" ID="regular_userid" runat="server" ValidationExpression="[A-Za-z0-9_\-\.]{0,}" />
</span></td>
</tr>
<tr bgcolor="#CCFFFF">
<td colspan="3"><asp:Label ID="Lab1" runat="server" /></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><span class="style1">以下信息对保证您的帐号的安全极为重要,请您务必认真填写。</span></td>
</tr>
<tr>
<td width="107" bgcolor="#FFFFFF"><p><span class="style1">*</span><span class="style5" style="color: #3036A9">输入登录密码:</span></p>
<p><span class="style1">*</span><span class="style5" style="color: #3036A9">确认登录密码:</span><br>
</p></td>
<td width="209" align="center"><asp:TextBox ID="user_password" TextMode="password" runat="server" />
<p>
<asp:TextBox ID="affirm_password" TextMode="password" runat="server" /> </p></td>
<td width="230"><span class="style5" style="color: #3036A9">用户名由a~z的英文字母(不区分大小写)、0~9的数字、点、减号或下划线组成,长度为4~18个字符,例如:kyzy_001。
<asp:CompareValidator ControlToCompare="user_password" ControlToValidate="affirm_password" Display="Dynamic" ErrorMessage="密码与确认密码必须相同!" ID="compare_password" Operator="Equal" runat="server" Type="String" />
</span></td>
</tr>
<tr bgcolor="#CCFFFF">
<td colspan="3"><asp:Label ID="Lab2" runat="server" /></td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0">

<tr>
<td width="105" bgcolor="#FFFFFF"><p><span class="style1">*</span><span class="style5" style="color: #3036A9">姓&nbsp;&nbsp;&nbsp;名:</span><span class="style3"><br>
</span></p>
</td>
<td width="211" align="center"> <p>
<asp:TextBox ID="user_name" TextMode="SingleLine" runat="server" />
</p></td><td width="230"><span class="style5" style="color: #3036A9">请填写您的真实姓名。
<asp:RequiredFieldValidator ControlToValidate="user_name" Display="Dynamic" ID="requir_name" runat="server" Text="请输入姓名!" />
</span></td>
</tr>
<tr bgcolor="#CCFFFF">
<td colspan="3">&nbsp;</td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="105" align="left" valign="middle" scope="col"><span class="style1">*</span><span class="style5" style="color: #3036A9">性&nbsp;&nbsp;&nbsp;别:</span></td>
<td width="212" align="center" scope="col">
<asp:RadioButtonList id="sex" RepeatDirection="Horizontal" runat="server">
<asp:Listitem value="male">男</asp:Listitem>
<asp:Listitem value="female">女</asp:Listitem>
</asp:RadioButtonList> </td>
<td width="225" align="left" scope="col"><span class="style5" style="color: #3036A9">请您选择性别。 </span></td>
</tr>
<tr bgcolor="#CCFFFF">
<td colspan="3"><asp:Label ID="Lab4" runat="server" /></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="105" align="left" valign="middle" scope="col"><span class="style1">*</span><span class="style5" style="color: #3036A9">出生日期:</span></td>
<td width="246" align="center" scope="col"> <asp:TextBox ID="bir_year" Text="19" MaxLength="4" TextMode="SingleLine" runat="server" width="30" />

<asp:DropDownList id="bir_month" runat="server">
<asp:Listitem value="jan" Selected="true">01</asp:Listitem>
<asp:Listitem value="feb" >02</asp:Listitem>
<asp:Listitem value="match" >03</asp:Listitem>
<asp:Listitem value="apr" >04</asp:Listitem>
<asp:Listitem value="may" >05</asp:Listitem>
<asp:Listitem value="jun" >06</asp:Listitem>
<asp:Listitem value="jul" >07</asp:Listitem>
<asp:Listitem value="aug" >08</asp:Listitem>
<asp:Listitem value="sep" >09</asp:Listitem>
<asp:Listitem value="oct" >10</asp:Listitem>
<asp:Listitem value="nov" >11</asp:Listitem>
<asp:Listitem value="dep" >12</asp:Listitem>
</asp:DropDownList >

<asp:DropDownList ID="bir_day" runat="server">
<asp:listitem value="one" selected="true" >01</asp:listitem>
<asp:listitem value="two" >02</asp:listitem>
<asp:listitem value="three" >03</asp:listitem>
<asp:listitem value="four" >04</asp:listitem>
<asp:listitem value="five" >05</asp:listitem>
<asp:listitem value="six" >06</asp:listitem>
<asp:listitem value="seven" >07</asp:listitem>
<asp:listitem value="eight" >08</asp:listitem>
<asp:listitem value="nine" >09</asp:listitem>
<asp:listitem value="ten" >10</asp:listitem>
<asp:listitem value="eleven" >11</asp:listitem>
<asp:listitem value="twelve" >12</asp:listitem>
<asp:listitem value="thirteen" >13</asp:listitem>
<asp:listitem value="fourteen" >14</asp:listitem>
<asp:listitem value="fifteen" >15</asp:listitem>
<asp:listitem value="sixteen" >16</asp:listitem>
<asp:listitem value="seventeen" >17</asp:listitem>
<asp:listitem value="eighteen" >18</asp:listitem>
<asp:listitem value="nineteen" >19</asp:listitem>
<asp:listitem value="twenty" >20</asp:listitem>
<asp:listitem value="twentyone" >21</asp:listitem>
<asp:listitem value="twentytwo" >22</asp:listitem>
<asp:listitem value="twentythree" >23</asp:listitem>
<asp:listitem value="twentyfour" >24</asp:listitem>
<asp:listitem value="twentyfive" >25</asp:listitem>
<asp:listitem value="twentysix" >26</asp:listitem>
<asp:listitem value="twentyseven" >27</asp:listitem>
<asp:listitem value="twentyeight" >28</asp:listitem>
<asp:listitem value="twentynine" >29</asp:listitem>
<asp:listitem value="thirty" >30</asp:listitem>
<asp:listitem value="thirtyone" >31</asp:listitem>
</asp:DropDownList>
日</td>
<td width="191" align="left" scope="col"><span class="style5" style="color: #3036A9">请填写您的真实生日,该项用于取回密码。</span></td>
</tr>
<tr bgcolor="#CCFFFF">
<td colspan="3"><asp:Label ID="Lab5" runat="server" /></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="105" align="left" valign="middle" scope="col"><p><span class="style1">*</span><span class="style5" style="color: #3036A9">证件类别:</span></p>
<p><span class="style3"><span class="style1">*</span><span class="style5">证件号码:</span><br>
</span></p></td>
<td width="246" align="center" valign="middle" scope="col">

<p>
<asp:DropDownList id="paper_sort" runat="server">
<asp:Listitem value="peoplesort" Selected="true">身份证</asp:Listitem>
<asp:Listitem value="studysort" >学生证</asp:Listitem>
<asp:Listitem value="teachersort" >教师资格证</asp:Listitem>
</asp:DropDownList >
</p>
<p>
<asp:TextBox ID="paper_num" TextMode="SingleLine" runat="server" /> </p></td>
<td width="191" align="left" class="style5" scope="col">有效证件作为取回帐号的最后手段,用以核实帐号的合法身份,请您务必如实填写。
<asp:RegularExpressionValidator ControlToValidate="paper_num" Display="Dynamic" ErrorMessage="请输入正确的证件号码" ID="regular_papernum" runat="server" Text="特别提醒:有效证件一旦设定,不可更改" ValidationExpression="[0-9]{0,}" /></td>
</tr>
<tr bgcolor="#CCFFFF">
<td colspan="3"><asp:Label ID="Lab6" runat="server" /></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="106" align="left" valign="middle" scope="col"><span class="style1">*</span><span class="style5" style="color: #3036A9">电子邮件:</span></td>
<td width="243" align="center" scope="col"><asp:TextBox ID="user_email" TextMode="SingleLine" runat="server" />
</td>
<td width="193" align="left" class="style5" scope="col"> 请输入电子邮件!
<asp:RegularExpressionValidator ControlToValidate="user_email" Display="Dynamic" ID="regular_email" runat="server" Text="邮件格式不正确!" ValidationExpression="[A-Za-z0-9_\-\.]{1,}@[A-Za-z0-9_\-\.]{0,}[.]{1,}[A-Za-z0-9_\-\.]{3,}" /> </td></tr>
<tr bgcolor="#CCFFFF">
<td colspan="3"><asp:Label ID="Lab7" runat="server" /></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="105" align="left" valign="middle" scope="col"><span class="style1">*</span><span class="style5" style="color: #3036A9">通讯地址:</span></td>
<td width="246" align="center" scope="col"><asp:TextBox ID="user_address" TextMode="SingleLine" runat="server" />
</td>
<td width="191" align="left" scope="col"><span class="style5" style="color: #3036A9; font-size: 12px;"> 请输入地址,如:江干区下沙路203弄123号200室
<asp:RegularExpressionValidator ControlToValidate="user_address" Display="Dynamic" ID="reg_address" runat="server" Text="请输入正确的地址!" ValidationExpression=".{1,}[区,县]{1}.{1,}路[0-9]{1,}弄[0-9]{1,}号[0-9]{1,}室" />
</span></td></tr>
<tr bgcolor="#CCFFFF">
<td colspan="3"></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle" scope="col">
<asp:Button ID="enter" Text="提交" runat="server" onclick="enter_click" />
<asp:Button ID="clear" Text="重置" runat="server" onclick="clear_click" /></td>
</tr>
<tr bgcolor="#CCFFFF">
<td>&nbsp;</td>
</tr>
<tr bgcolor="#CCFFFF">
<td bgcolor="#FFFFFF"><asp:Label ID="messages" runat="server" /></td>
</tr>
</table> <br></td>
</tr>
</table>
</form>
</body>
</html>
<!--#include file="bottom.aspx"-->
搜索更多相关主题的帖子: 注册页面 server 朋友 
2007-11-14 10:22
快速回复:求助一点击事件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021014 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved