if (!IsPostBack) BookList1.PageIndex = 1;
BindBookList(BookTypeID,BookOrderByFields.DateAdded); BookList1.LblSearchCondition.Text = \搜索类别:\ + BookTypeName; } }
private string BookTypeID get
{ if(BookTypeTreeNavigationExpanded1._SelectedNode==null) if (Request.QueryString[\] == null) return null;
return Request.QueryString[\].ToString(); } else
{ return BookTypeTreeNavigationExpanded1._SelectedNode.Value } } }
private string BookTypeName
{ get { if (Request.QueryString[\] == null) return null;
returnUri.UnescapeDataString( Request.QueryString[\\].ToString());} }
2会员的登录注册信息 如图所示:
主要代码如下:
protected void RegisterClick(object sender, EventArgs e) { if (!Page.IsValid)
return; BookShopOnline.Model.User user = new User(); user.RoleID =(int) Role.RegisterUser; //必填项 user.UserName = RegisterUser1.TxtUserName.Text; user.UserPwd = RegisterUser1.TxtUserPwd.Text; user.Email = RegisterUser1.TxtEmail.Text; //选填项 user.RealName = RegisterUser1.TxtRealName.Text; user.PostalCode = RegisterUser1.TxtPostalCode.Text; user.Phone = RegisterUser1.TxtPhone.Text; user.Address = RegisterUser1.TxtAddress.Text;
int result = new UserBll().InsertUser(user);
if (result == -2) { RegisterUser1.LblMsg.Text = \注册失败!该用户名已存在。\; return; }
if (result == -3) { RegisterUser1.LblMsg.Text = \注册失败!该Email已存在。\; return; if (result==1)
{ Response.Redirect(\ + hyperFromUrl.NavigateUrl); } }
else { RegisterUser1.LblMsg.Text = \注册失败!检查输入并重 试。\; } }
3图书分类及列表信息:如图所示:
主要代码如下:
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(BookTypeID)) return; if (!IsPostBack) { BookList1.PageIndex = 1; BindBookList(BookTypeID,BookOrderByFields.DateAdded); BookList1.LblSearchCondition.Text = \搜索类别:\ + BookTypeName; } } private string BookTypeID
{ get { if(BookTypeTreeNavigationExpanded1._SelectedNode==null)
{ if (Request.QueryString[\] == null) return null; return Request.QueryString[\].ToString();} else { returnBookTypeTreeNavigationExpanded1._SelectedNode.Value; }
}
} private string BookTypeName
{ get (if (Request.QueryString[\] == null) return null; return
Uri.UnescapeDataString( Request.QueryString[\].ToString()); }
以下为图示的详细信息页面: