protected void Page_Load(object sender, EventArgs e) { booknam = Request.QueryString["bookname"]; Srisiddeswari db = new Srisiddeswari(); var prodbkdetl = (from q in db.Siddeswari_Master_Books where q.SiddOrgBookname == booknam where q.SiddOrgDispPage == "Librarypage" select new { q.SiddOrgBookname, q.SiddOrgBookimg, q.SiddOrgBookDesc, q.SiddOrgBookprice, q.SiddOrgBkstck, q.SiddOrgsaleprice, q.SiddOrgbkrating }).ToList(); prodbkdtl.DataSource = prodbkdetl; prodbkdtl.DataBind(); }
protected void Btnsub_Click(object sender, EventArgs e) { Srisiddeswari db = new Srisiddeswari(); string userid = Txtemail.Text.Trim(); string passwd = Txtpassword.Text.Trim(); try { var vldlogin = (from q in db.Siddeswari_Login where q.SiddOrgUserID == userid && q.SiddOrgPassword == passwd select new { }).ToList(); if (vldlogin.Count == 1) { var usrdetl = (from q in db.Siddeswari_Master_Customer where q.SiddOrgCustEmailID == Txtemail.Text.Trim() select new { q.SiddOrgCustFirstName }).FirstOrDefault(); Session["UserName"] = usrdetl.SiddOrgCustFirstName.Trim(); Session["UserID"] = userid; Application["Usercustid"] = Txtemail.Text.Trim(); System.Web.Security.FormsAuthentication.SetAuthCookie(userid, true); Response.Redirect("Siddeswariafterlogin.aspx", false); } else { lblmsg.Text = "Login credentials are wrong,Please enter correct details"; lblmsg.ForeColor = System.Drawing.Color.Red; } } catch (Exception ex) { throw (ex); } }