protected void Save_Pass(object sender, EventArgs e) { StudLoginFields ef = new StudLoginFields(); Service my = new Service(); ef.Pass = pass.Text; ef.ConfirmPass = pass1.Text; ef.Email = EMAIL.Text; ef.AppID = Int32.Parse(uid.Text); try { // string myMsg = my.Genrate_Pass(ef); string url = "/Student/StudLogin.aspx"; string script = "window.onload = function(){ alert('"; script += myMsg; script += "');"; script += "window.location = '"; script += url; script += "'; }"; ClientScript.RegisterStartupScript(this.GetType(), "Redirect", script, true); } catch (Exception ex) { Response.Write(ex); } }
protected void Reset_Pass(object seder, EventArgs e) { StudLoginFields ef = new StudLoginFields(); Service my = new Service(); ef.Pass = NewPass.Text; ef.ConfirmPass = Newpass1.Text; ef.OldPass = CurrPass.Text; ef.AppID = Int32.Parse(appid.Text); try { string myMsg = my.Pass_Reset(ef); string url = "/Student/StudDash.aspx"; string script = "window.onload = function(){ alert('"; script += myMsg; script += "');"; script += "window.location = '"; script += url; script += "'; }"; ClientScript.RegisterStartupScript(this.GetType(), "Redirect", script, true); } catch (Exception ex) { Response.Write(ex); } }
protected void btn_login(object sender, EventArgs e) { StudLoginFields ef = new StudLoginFields(); Service my = new Service(); ef.AppID = Int32.Parse(Appid.Text); ef.Pass = pass.Text; try { string res = my.Stud_Login(ef); Response.Write(res); if (res.Equals("Login sucess")) { Session["appid"] = Appid.Text; Response.Redirect("/Student/StudDash.aspx"); } else { string url = "/Student/StudLogin.aspx"; string script = "window.onload = function(){ alert('"; script += res; script += "');"; script += "window.location = '"; script += url; script += "'; }"; ClientScript.RegisterStartupScript(this.GetType(), "Redirect", script, true); } } catch (Exception ex) { Response.Write(ex); } }