Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- if (!String.IsNullOrEmpty(Request.QueryString["id"]))
- {
- string guid = Request.QueryString["id"].ToString();
- using (var db = new Entities())
- {
- var q = from u in db.Users
- where u.UniGuid == guid
- select u;
- if (q.Any())
- {
- Label1.Text = "You have to fill the blank below to change your password";
- }
- btnReset.Visible = true;
- txtPassword.Visible = true;
- }
- }
- }
- }
- protected void btnReset_Click(object sender, EventArgs e)
- {
- string guid = Request.QueryString["id"].ToString();
- using (var db = new Entities())
- {
- var q = from u in db.Users
- where u.UniGuid == guid
- select u;
- if (q.Any())
- {
- //Users u = new Users();
- //u.Password = txtPassword.Text;
- q.First().Password = txtPassword.Text;
- db.SaveChanges();
- }
- }
- }
- var objUser = db.Users
- .FirstOrDefault(x => x.UniGuid.Equals(guid));
Add Comment
Please, Sign In to add comment