//------------------------------------------------------------------------------------------------------------------------ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //---------------------------------------------------------------------------------------------------------------- // Is Key Presents //---------------------------------------------------------- if (Request.QueryString["key"] != null) { //----------------------------------------------------- // Storing Into Hidden Field //----------------------------------------------------- HF_SeqtID.Value = Request.QueryString["key"]; //----------------------------------------------------- } else { //----------------------------------------------------- //Session Variable Not found //----------------------------------------------------- Server.Transfer("~/Extras/ErrorReport.aspx?id=Session"); //----------------------------------------------------- } } else { //-------------------------------------------------------------------------------------------------------------------------------------------- string strApplicationID; try { //----------------------------------------------------------------------------------------------------------------------------------------- // Getting ApplicationID for given UserID strApplicationID = MatrimonialMemberShip.GetApplicationID(Session[HF_SeqtID.Value].ToString(), true, false); // No More Use Of Session Variable Session.Remove(Request.QueryString["key"]); // Changing The Password MatrimonialMemberShip.SetPassword(strApplicationID, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password_Conform.Text, "MD5")); Response.Redirect("~/Guest/Login.aspx"); //----------------------------------------------------------------------------------------------------------------------------------------- } catch (Exception Ex) { //----------------------------------------------------- //Session Variable Not found //----------------------------------------------------- ErrorLog.WriteErrorLog("Guest_newPassword.PostBack", Ex); Server.Transfer("~/Extras/ErrorReport.aspx?id=Session"); //----------------------------------------------------- } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Adding meta Discription HtmlMeta objMeta = new HtmlMeta(); objMeta.Name = "Description"; objMeta.Content = WebConfig.GetValues("MetaDiscription"); this.Header.Controls.Add(objMeta); // Adding meta KeyWords objMeta = new HtmlMeta(); objMeta.Name = "keywords"; objMeta.Content = WebConfig.GetValues("MetaKeword"); this.Header.Controls.Add(objMeta); } else { Page.Validate(); if (IsValid) { HttpCookieCollection objHttpCookieCollection = Request.Cookies; HttpCookie objHttpCookie = objHttpCookieCollection.Get("MatCookie5639sb"); string strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]); if (MatrimonialMemberShip.IsPasswordTrue(strApplicationID, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password_OLd.Text, "MD5")))// checkPassword(.text) { MatrimonialMemberShip.SetPassword(strApplicationID, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password_New.Text, "MD5"), FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password_OLd.Text, "MD5")); L_PasswordChanged.Visible = true; L_WrongPassword.Visible = false; } else { L_WrongPassword.Visible = true; L_PasswordChanged.Visible = false; } } } }