ASP数据库,数据源是怎么回事

ifredom_ 2011-10-10 01:29:46
ASP初学。登陆界面与数据库的链接是怎么回事,泪奔无师傅。
<form name="form" method="post" action="test_002.asp">
用户名:<input name="name" type="text"id="name">
<p>电子信箱:<input name="email"type="text"id="email"></p>
<p>
<input type="submit" name="submit" value="提交">
<input type="reset" name="submit2" value="重置">
</p>
</form>
用户名和密码怎么链接数据库呢
...全文
78 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ifredom_ 2012-03-17
  • 打赏
  • 举报
回复
感谢啊,后面不知不觉知道了,就没注意提问帖 未能及时回复 抱歉
sy_binbin 2011-10-10
  • 打赏
  • 举报
回复
http://blog.sina.com.cn/s/blog_51c0c7620100d7mx.html

参考这里的代码
sunlifei 2011-10-10
  • 打赏
  • 举报
回复
login.aspx页面中代码
<body>
<form id="form1" runat="server">
<div style="width:1024px; height:650px; background-image:url(img/control/login.jpg); margin-left:auto; margin-right:auto;">
<div style="position:relative; width:210px; height:106px; left: 542px; top: 289px;">
<asp:TextBox ID="UserName" runat="server" Width="127px" style="position:relative; top:2px; left:75px;"></asp:TextBox>
<asp:TextBox ID="PassWord" TextMode="Password" runat="server" Width="127px" style="position:relative; top:10px; left:75px;"></asp:TextBox>
<asp:Button ID="lnk_Login" runat="server" Text="登录" Width="97px" Height="30px" CssClass="button" style="cursor:pointer; position:relative; top:32px; left:0px; outline:none" OnClick="lnk_Login_Click" />
<input id="Reset" type="reset" value="取消" class="button" style="cursor:pointer; position:relative; top:33px; left:9px; outline:none" />
<br />
<asp:Label ID="FailInfo" runat="server" Text="" style="position:relative; top:40px; color:Red; font-size:13px;"></asp:Label>
</div>
</div>
</form></body>


login.aspx.cs中代码
protected void Page_Load(object sender, EventArgs e)
{

}

protected void lnk_Login_Click(object sender, EventArgs e)
{

string un = UserName.Text.Trim();// == "" ? "xiaoyan.zhang" : UserName.Text.Trim();
string pw = PassWord.Text.Trim();// == "" ? "1" : PassWord.Text.Trim();

//处理登录信息

}
sunlifei 2011-10-10
  • 打赏
  • 举报
回复
在web.config里面配置数据库的链接

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧