using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;public partial class Login : System.Web.UI.Page
{ protected void btnLogin_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
shopbase loginDB = new shopbase();
string tempCartID = loginDB.GetShoppingCartId();
string customerid = loginDB.Login(txtUserName.Text.ToString(), txtPassword.Text.ToString());
if (customerid != null)
{
//loginDB.TransplantShoppingCart(tempCartID, customerid.ToString());
CustomerDetails customerDetails = loginDB.GetCustomerDetails(customerid);
Response.Cookies["Store_CustomerName"].Value = loginDB.GetCustomerDetails(customerid).CustomerName;
FormsAuthentication.RedirectFromLoginPage(customerid, true);
}
else
{
Message.Text = "用户名或密码错误,请重新登录";
}
}
}
protected void btnRegister_Click(object sender, EventArgs e)
{
Response.Redirect("Register.aspx");
}
}
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;public partial class Login : System.Web.UI.Page
{ protected void btnLogin_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
shopbase loginDB = new shopbase();
string tempCartID = loginDB.GetShoppingCartId();
string customerid = loginDB.Login(txtUserName.Text.ToString(), txtPassword.Text.ToString());
if (customerid != null)
{
//loginDB.TransplantShoppingCart(tempCartID, customerid.ToString());
CustomerDetails customerDetails = loginDB.GetCustomerDetails(customerid);
Response.Cookies["Store_CustomerName"].Value = loginDB.GetCustomerDetails(customerid).CustomerName;
FormsAuthentication.RedirectFromLoginPage(customerid, true);
}
else
{
Message.Text = "用户名或密码错误,请重新登录";
}
}
}
protected void btnRegister_Click(object sender, EventArgs e)
{
Response.Redirect("Register.aspx");
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货