473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Pages User Permissions

hi,

How can I setup the user permissions over some pages of my web application?
I want to deny that some users access some of my web pages. How can I do
this in code?

At this moment I have a session variable that have False or True value. I
get this value from my DB.
Then in my Page_Load event I have this:

Sub Page_Load (...)
If CBool(Session.Item("bValue")) Then
//some code here
Else
Page.Controls.Clear()
Response.Redirect("dcsError.htm", False)
End If
End Sub

but I think that must be another way to do this
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 18 '05 #1
2 1656
> How can I setup the user permissions over some pages of my web
application?
I want to deny that some users access some of my web pages. How can I do
this in code?
At this moment I have a session variable that have False or True value. I
get this value from my DB.
You don't want to do that, .NET has authentication abilities built in that
are quite nice, and easy to use.

See this article:
http://msdn.microsoft.com/library/de...entication.asp
HTH,
Jeremy
"ruca" <ru***@iol.pt> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl... hi,

How can I setup the user permissions over some pages of my web application? I want to deny that some users access some of my web pages. How can I do
this in code?

At this moment I have a session variable that have False or True value. I
get this value from my DB.
Then in my Page_Load event I have this:

Sub Page_Load (...)
If CBool(Session.Item("bValue")) Then
//some code here
Else
Page.Controls.Clear()
Response.Redirect("dcsError.htm", False)
End If
End Sub

but I think that must be another way to do this
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #2
Forms Authentication is very handy for this kind of thing. It's sufficient
for basic needs and can usually be extended for more advanced needs.
Here's more info:
http://www.dotnetbips.com/displayarticle.aspx?id=9
http://www.4guysfromrolla.com/webtech/121901-1.2.shtml
http://www.dotnetbips.com/displayarticle.aspx?id=117

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"ruca" <ru***@iol.pt> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl...
hi,

How can I setup the user permissions over some pages of my web application? I want to deny that some users access some of my web pages. How can I do
this in code?

At this moment I have a session variable that have False or True value. I
get this value from my DB.
Then in my Page_Load event I have this:

Sub Page_Load (...)
If CBool(Session.Item("bValue")) Then
//some code here
Else
Page.Controls.Clear()
Response.Redirect("dcsError.htm", False)
End If
End Sub

but I think that must be another way to do this
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael | last post by:
I have several website that use asp pages and backend databases running on my win2000 server. I removed everyone from the permissions on all of my Hard drives and added the annonymous user to the...
3
by: Jennifer Sanders | last post by:
We're running windows 2000 server with IIS 5.0. We're trying to execute .asp scripts but we keep getting the 500 (internal server) error. It looks like the permissions might be corrupted. When...
3
by: Darren | last post by:
I had to restore my server from backup. When I did, I could no longer access any asp pages on my web server. The error says HTTP 500 Internal Server Error. I have turned off friendly HTTP error...
10
by: Kenny Ashton | last post by:
Hi all Can anyone tell me the best way to set permissions to allow an ASP program to write new Html pages to my site's root folder, without chancing users also being able to write to the root....
2
by: Brian Bischof | last post by:
I've spent the past three hours struggling with this one and Googled the hell out of it. Please help! I ran IISLockdown for another problem and it trashed IIS. ASP pages wouldn't run at all. So...
1
by: abdulrauf | last post by:
Hope someone can help. I am trying to build an application that will allow a user to access/deny an application, the application's individual pages, and the forms within the individual pages. ...
2
by: ruca | last post by:
hi, How can I setup the user permissions over some pages of my web application? I want to deny that some users access some of my web pages. How can I do this in code? At this moment I have a...
4
by: Greg | last post by:
I have a complex page (with 8 complex user controls, and many other asp.net controls.) I have 2 very similiar pages to create, each page differing only from the others in one control. What is...
3
by: Phil | last post by:
Jerry posed some good ideas, a while back, on website a security issue that comes up often. Gary Jones was asking how to keep users from directly accessing php pages, out of sequence. Jerry...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.