-
Notifications
You must be signed in to change notification settings - Fork 2
/
parents.aspx.cs
73 lines (65 loc) · 2.05 KB
/
parents.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using fee;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Visible = false;
if (Page.IsPostBack == false)
{
if (Request.Cookies["email"] != null && Request.Cookies["password"] != null)
{
username.Text = Request.Cookies["email"].Value;
password.Attributes["value"] = Request.Cookies["password"].Value;
}
}
}
protected void submit_Click(object sender, EventArgs e)
{
clsregister obj = new clsregister();
clsregistrationprp objprp = new clsregistrationprp();
objprp.email = username.Text;
objprp.password = password.Text;
try
{
int a= obj.parent_login(objprp);
int b=obj.parent_login(objprp);
Session["cod"] = a;
Session["stu"] = b;
if(Convert.ToInt32 ( Session["cod"])!=0)
{
Response.Redirect("next/parent/detailpa.aspx");
}
else
{
Label1.Visible = true;
Label1.Text = "invalid Email Password";
}
}
catch (Exception exp)
{
Label1.Visible = true;
Label1.Text = "Error!!!";
}
}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked)
{
Response.Cookies["email"].Expires = DateTime.Now.AddDays(30);
Response.Cookies["password"].Expires = DateTime.Now.AddDays(30);
}
else
{
Response.Cookies["email"].Expires = DateTime.Now.AddDays(-1);
Response.Cookies["password"].Expires = DateTime.Now.AddDays(-1);
}
Response.Cookies["email"].Value = username.Text.Trim();
Response.Cookies["password"].Value = password.Text.Trim();
}
}