求:access数据库+注册框代码提交到数据库中

wq568568 2011-08-07 09:17:19
前台页面我搞好, 求个后台代码, 只要把注册信息提交到数据库中就可以了
login.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="users_login" %>

<!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 id="Head1" runat="server">
<title>用户端验证注册</title>
<script language="javascript" type="text/javascript">
function checksubmit()
{
var username=document.all("txtname").value
var userpwd1=document.all("txtpassword1").value
var userpwd2=document.all("txtpassword2").value
// var question=document.all("drquestion").value
// var answer = document.all("txtanswer").value
var qqname = document.all("txtqq").value
var email = document.all("txtemail").value
var zhenshi = document.all("txtzhenshil").value
var guhua = document.all("txtguhua").value
var addrees = document.all("txtaddrees").value
var Mobile = document.all("txtMobile").value
// var identity = document.all("txtid").value
if(username=="")
{
alert("用户名不能为空!")
return false
}
if(userpwd1=="")
{
alert("密码不能为空!")
return false
}
if(userpwd1!=userpwd2)
{
alert("两次输入的密码不一致,请重新输入!")
return false
}
if (qqname == "")
{
alert("QQ不能为空!")
return false
}
patten=/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/
if(email==""||!patten.exec(email))
{
alert("email地址不正确!")
return false
}
if (zhenshi == "") {
alert("真实姓名不能为空!")
return false
}
if (addrees == "") {
alert("地址不能为空!")
return false
}
if (Mobile == "") {
alert("手机号码不能为空!")
return false
}
return true
}
</script>
</head>
<body>
<form id="form1" runat="server" method="post" onsubmit="return checksubmit()">
<table style="width: 384px; height: 340px; border-right: lavender thin double; border-top: lavender thin double; border-left: lavender thin double; border-bottom: lavender thin double;" border="0" align="center">
<tr>
<td align="center" bgcolor="#99ccff" colspan="2">
用户注册</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblmessage" runat="server" Width="310px" ForeColor="Red"></asp:Label></td>
</tr>
<tr>
<td style="width: 122px" align="right">
用户名:</td>
<td style="width: 118px; color: red">
<asp:TextBox ID="txtname" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 27px" align="right">
密码:</td>
<td style="width: 118px; color: red; height: 27px">
<asp:TextBox ID="txtpassword1" runat="server" TextMode="Password" Width="147px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 28px;" align="right">
确认密码:</td>
<td style="width: 118px; color: red; height: 28px;">
<asp:TextBox ID="txtpassword2" runat="server" TextMode="Password" Width="147px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
qq号:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtqq" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px; height: 21px" align="right">
邮箱:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtemail" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
性别:</td>
<td style="width: 118px">
<asp:DropDownList ID="Drsex" runat="server" Width="48px">
<asp:ListItem>男</asp:ListItem>
<asp:ListItem>女</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
姓名:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtzhenshil" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td align="right" style="width: 122px">
固话:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtguhua" runat="server" Width="146px"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
地址:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtaddrees" runat="server" Width="146px"></asp:TextBox>*</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size:5px">
--------------------------------------------------------------------------------------------------------------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 122px" align="right">
手机号码:</td>
<td style="width: 118px; height: 21px; color: red;">
<asp:TextBox ID="txtMobile" runat="server" Width="146px"></asp:TextBox>*
</td>
</tr>
<tr>
<td style="text-align: center;" align="right" colspan="2">

</td>
</tr>
<tr>
<td align="center" colspan="2" style="height: 26px">
       <input type="reset" name="button" id="button" value="重置" />
        <asp:Button ID="Button1"
runat="server" Text="提交" onclick="Button1_Click1" />
  </td>
</tr>
</table>
</form>
</body>
</html>
后台代码:
求个后台代码, 只要把注册信息提交到数据库中就可以了,asp.net新人,望大家指点谢谢
...全文
117 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
baifucn 2011-09-15
再顶一次
回复
baifucn 2011-09-15
2楼 你说的没道理 图片还是没有源码有用
回复
baifucn 2011-09-15
帮你顶顶
回复
uncle_bacon 2011-09-15
帮顶下.
回复
szrstt 2011-09-10
你发这么多还不如直接传两张图片上来
回复
占位置帮你顶顶...........
回复
相关推荐
发帖
.NET技术其他语言
创建于2007-09-28

1834

社区成员

.NET技术 其他语言讨论
申请成为版主
帖子事件
创建了帖子
2011-08-07 09:17
社区公告
暂无公告