-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.aspx.cs
53 lines (47 loc) · 1.6 KB
/
home.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
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;
namespace uni_admission
{
public partial class home1 : System.Web.UI.Page
{
SqlConnection connect = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
if (connect.State == ConnectionState.Open)
{
connect.Close();
}
connect.Open();
/*HttpCookie cookie = Request.Cookies["UserDetails"];
if (cookie != null)
{
Label1.Text += cookie["email"];
}
if (Session["email"] != null)
{
Label1.Text += Session["email"].ToString();
}
else
Response.Redirect("ulogin.aspx");
SqlCommand cmd = connect.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from user where email='" + Session["email"].ToString() + "'";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();*/
}
protected void logout_Click(object sender, EventArgs e)
{
Response.Redirect("ulogin.aspx");
}
}
}