-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMasterPage.master.cs
79 lines (60 loc) · 1.74 KB
/
MasterPage.master.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
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Email_ID"] == null)
{
HyperLink1.Visible = false;
}
else
HyperLink1.Visible = true;
}
protected void ibtnSearch_Click(object sender, ImageClickEventArgs e)
{
}
protected void btnRegister_Click(object sender, EventArgs e)
{
Response.Redirect("Register.aspx");
}
protected void btnReset_Click(object sender, EventArgs e)
{
txtEmail_ID.Text = "";
txtPassword.Text = "";
}
protected void btnLogin_Click(object sender, EventArgs e)
{
string email_id = txtEmail_ID.Text;
string password = txtPassword.Text;
UserBLL ub = new UserBLL();
int login= ub.Login(email_id,password);
if (login == 1)
{
Session["Email_ID"] = email_id;
Response.Redirect("ViewMyPost.aspx");
}
else if (login == 10)
{
Session["Email_ID"] = email_id;
Response.Redirect("Admin.aspx");
}
else
{
Response.Write("<script language='javascript'>alert('Email_ID and Password are incorrect !');</script>");
Response.Redirect("Register.aspx");
}
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
Session["Search"] = txtSearch.Text;
Response.Redirect("Search.aspx");
}
}