I used and i made my Login system so, there were rolls i made..
Concentrate the Scenario:
its my Login Table
UserName ---- Password ---- CampusCode
MyName ---- 123PW ------- NK
On login page I Coded like this
str = "select * from login where Username =@username and Password =@password";
cmd = new SqlCommand(str, con);
cmd.Parameters.AddWithValue("@username", txtUsername.Text);
cmd.Parameters.AddWithValue("@password", txtPass.Text);
sdr = cmd.ExecuteReader();
if (sdr.Read())
{
Session["Campus"] = sdr["CampusCode"].ToString(); // then Responce.reditect to another page then
So I took value of Campus By Session now , on 2nd Page On top right i put the Label and Put the Session value of Campus.
MahadPK
Participant
778 Points
225 Posts
Re: Adding roles and permissions to a traditional web app?
Apr 30, 2012 09:28 PM|LINK
I used and i made my Login system so, there were rolls i made..
Concentrate the Scenario:
its my Login Table
UserName ---- Password ---- CampusCode
MyName ---- 123PW ------- NK
On login page I Coded like this
str = "select * from login where Username =@username and Password =@password"; cmd = new SqlCommand(str, con); cmd.Parameters.AddWithValue("@username", txtUsername.Text); cmd.Parameters.AddWithValue("@password", txtPass.Text); sdr = cmd.ExecuteReader(); if (sdr.Read()) { Session["Campus"] = sdr["CampusCode"].ToString(); // then Responce.reditect to another page thenSo I took value of Campus By Session now , on 2nd Page On top right i put the Label and Put the Session value of Campus.
then on page load i Programed like
if (Label.Text = "NK") { panel1.visible = false; } else if ( Label.Text = "2nd Campus etc") { Panel2.Visible = true; }More over you will have to work hard for it. but you can do better in asp.net Membership system.