By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Pages User Permissions

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
> 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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.