473,800 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.I tem("bValue")) Then
//some code here
Else
Page.Controls.C lear()
Response.Redire ct("dcsError.ht m", 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 1676
> 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******** ******@TK2MSFTN GP12.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.I tem("bValue")) Then
//some code here
Else
Page.Controls.C lear()
Response.Redire ct("dcsError.ht m", 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******** ******@TK2MSFTN GP12.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.I tem("bValue")) Then
//some code here
Else
Page.Controls.C lear()
Response.Redire ct("dcsError.ht m", 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
1411
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 winnt folder and the wwwroot folder and all of the folders within these directories. Now my sites that just run straight html work fine but my sites with .asp pages are having problems. However if I add the Domain Administrator account as the...
3
2929
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 I go to the folder in question, go to properties >> security and look at the user groups, for several seconds they say this: S-1-1-0
3
7476
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 messages and it gives me less info. All it says is server application error. html or htm pages work fine. I have reinstalled com+ so that I can now access the components services snap-in.
10
1846
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. One ISP told me this couldn't be done - is IIS really that limited? I want to be able to suggest to my ISP (based on any advice you can give) how they should set the permissions to allow a sensible folder structure -
2
1913
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 I Googled it forever to no avail. So I unsintalled IIS and resintalled it. Now the status is that ASP pages ask me to login and then they run. I assigned the maximum permissions to the IUSR_xxx account as well as gave it read permissions to the...
1
1427
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. For example once a user log's in the application will check whether the user can access the application's main page. If so it lets him/her see the page.
2
1203
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 session variable that have False or True value. I get this value from my DB. Then in my Page_Load event I have this:
4
1860
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 the best way to achieve this? I would guess that I have 3 alternatives. 1.) Visual and Logic inheritance. I know absolutely nothing about this in ASP.NET, and I haven't found anything that appears immediately simple ( i am in a rush to get this job...
3
2048
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 posed a directory management solution. No one seems to have mentioned an alternative. Maybe there is a reason? We took a different approach, noting that the only way we wanted a user to enter some phps would be through a predefined series of steps...
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.