-
Notifications
You must be signed in to change notification settings - Fork 2
/
Index.aspx.cs
45 lines (34 loc) · 1.07 KB
/
Index.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
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;
public partial class _Default : System.Web.UI.Page
{
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
hfUserID.Value = Login1.UserName;
hfPwd.Value = Login1.Password;
DataView dv=(DataView)sqlLogin.Select(new DataSourceSelectArguments());
if (dv.Count == 1)
{
String userrole=(String)dv[0][0];
Session.Add("userid", hfUserID.Value);
if (userrole == "student")
Server.Transfer("StudHome.aspx");
if (userrole == "expert")
Server.Transfer("ExpertHome.aspx");
if (userrole == "admin")
Server.Transfer("AdminHome.aspx");
}
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
}
public void ShowUsers()
{
}
}