| | |
Asp.net Page access Control
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 8
Reputation:
Solved Threads: 1
you can make access to different pages by using Session.
every user has its own role. so in database define Roles for every user.
like
there would be three fields ..
User name , Password and Role.
when you click on the button sign in
if the username and password matched.
put the respective role in the session variable like that.
like .... Session["Role"] = "Admin";
now check in every page_load event of every page.
like
Page_Load()
{
if(Session["Role"].ToString() != "Admin")
{
Response.Redirect("Login.aspx");
}
// same thing u can use for every user role
}
every user has its own role. so in database define Roles for every user.
like
there would be three fields ..
User name , Password and Role.
when you click on the button sign in
if the username and password matched.
put the respective role in the session variable like that.
like .... Session["Role"] = "Admin";
now check in every page_load event of every page.
like
Page_Load()
{
if(Session["Role"].ToString() != "Admin")
{
Response.Redirect("Login.aspx");
}
// same thing u can use for every user role
}
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Simple ASP.Net Login Page using C# (C#)
- ASP.NET wizard control (ASP.NET)
- Dual use of <asp:TextBox in ASP.NET page (JavaScript / DHTML / AJAX)
- Uploading files Access Denied Error (ASP.NET)
- ASP.Net Security 101 Part 1 (ASP.NET)
- ASP.NET Tutorial: Caching in ASP.NET (ASP.NET)
- I Need Sample ASP.NET Code (ASP.NET)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Defalut page for website not getting accessed
- Next Thread: error in database connection
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child click commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose feedback flash flv form formatdecimal forms formview gridview homeedition hosting iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news numerical objects order panelmasterpagebuttoncontrols radio ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql-server sqlserver2005 suse textbox tracking typeof unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webarchitecture webdevelopemnt webservice xml youareanotmemberofthedebuggerusers





