public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.Cookies["name"].Value != null)
{
Server.Transfer("Default2.aspx");
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text != "")
{
Response.Cookies["name"].Value = TextBox1.Text;
Response.Cookies["name"].Expires = DateTime.Now.AddDays(1);
Server.Transfer("Default2.aspx");
}
}
}
这样子就好了
[ 本帖最后由 notlook 于 2010-7-3 10:54 编辑 ]
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.Cookies["name"].Value != null)
{
Server.Transfer("Default2.aspx");
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text != "")
{
Response.Cookies["name"].Value = TextBox1.Text;
Response.Cookies["name"].Expires = DateTime.Now.AddDays(1);
Server.Transfer("Default2.aspx");
}
}
}
这样子就好了
[ 本帖最后由 notlook 于 2010-7-3 10:54 编辑 ]