.aspx制作链接数据库并互相跳转的登录与注册
2012-10-08 13:46:41 来源:WEB开发网核心提示:<tr><td>生 日:</td><td><asp:Label ID="Birthday" runat="server" Text=""></asp:Label></td>&l
<tr><td>生 日:</td><td><asp:Label ID="Birthday" runat="server" Text=""></asp:Label></td></tr>
<tr><td>头 像:</td><td> <asp:Image ID="img1" runat="server" /></td></tr>
<tr><td>简 介:</td><td><asp:Label ID="BriefIntroduction" runat="server" Text=""></asp:Label></td></tr>
<tr><td></td><td>
<asp:Button ID="Button1" runat="server" Text="登陆" Xonclick="Button1_Click" /></td></tr>
</table>
</div>
</form>
</body>
</html>
WebFanKui.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Webdenglu
{
public partial class WebFanKui : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
username.Text = Session["username"].ToString();
Password.Text = Session["password"].ToString();
sex.Text = Session["Sex"].ToString();
hobby.Text = Session["Hobby"].ToString();
Email.Text = Session["Emain"].ToString();
Birthday.Text = Session["Birthday"].ToString();
img1.ImageUrl = Session["img"].ToString();
BriefIntroduction.Text = Session["BriefIntroduction"].ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>alert('登陆成功');window.location='WebWelcome.aspx';</script>");
}
}
}
WebDengLu.aspx:
<%@ Page Xlanguage="C#" AutoEventWireup="true" CodeBehind="WebDengLu1.aspx.cs" Inherits="Webdenglu.WebDengLu1" Debug="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tr><td>头 像:</td><td> <asp:Image ID="img1" runat="server" /></td></tr>
<tr><td>简 介:</td><td><asp:Label ID="BriefIntroduction" runat="server" Text=""></asp:Label></td></tr>
<tr><td></td><td>
<asp:Button ID="Button1" runat="server" Text="登陆" Xonclick="Button1_Click" /></td></tr>
</table>
</div>
</form>
</body>
</html>
WebFanKui.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Webdenglu
{
public partial class WebFanKui : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
username.Text = Session["username"].ToString();
Password.Text = Session["password"].ToString();
sex.Text = Session["Sex"].ToString();
hobby.Text = Session["Hobby"].ToString();
Email.Text = Session["Emain"].ToString();
Birthday.Text = Session["Birthday"].ToString();
img1.ImageUrl = Session["img"].ToString();
BriefIntroduction.Text = Session["BriefIntroduction"].ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>alert('登陆成功');window.location='WebWelcome.aspx';</script>");
}
}
}
WebDengLu.aspx:
<%@ Page Xlanguage="C#" AutoEventWireup="true" CodeBehind="WebDengLu1.aspx.cs" Inherits="Webdenglu.WebDengLu1" Debug="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
<title></title>
<style type="text/css">
.div1
{
margin:0 auto;
border:1px solid red;
height: 257px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div >
<table class="div1" >
<tr><td></td><td>登录页面</td></tr>
<tr><td align="right">用户名:</td><td>
<asp:TextBox ID="username" runat="server" AutoPostBack="True"
Xontextchanged="TextBox1_TextChanged"></asp:TextBox></td><td>
<asp:Label ID="Label1" runat="server"></asp:Label>
更多精彩
赞助商链接