943,648 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 572
  • ASP.NET RSS
May 11th, 2009
0

Displaying Pages Dynamic to users

Expand Post »
Hello,
I am using visual webdeveloper 2008,
I have created users using asp.net configuration.
Now i am having 2 roles admin and users,
And i am having 3 pages as login,register,secured
So wen i enter the website as admin all these 3 pages must be visible to the user.
Wen i enter as guest it must show only register and login
After i login it must not show register and login

How to set pages like that???
Thanks.
Similar Threads
Reputation Points: 8
Solved Threads: 3
Junior Poster
bharanidharanit is offline Offline
140 posts
since Nov 2008
May 18th, 2009
0

Re: Displaying Pages Dynamic to users

you can save the role in a session variable and accordingly show the respective pages..
eg.
asp.net Syntax (Toggle Plain Text)
  1. if(txtusername.Text=="ADMIN")
  2. {
  3. show desired pages
  4. }
  5. else
  6. if(txtusername.Text=="USER")
  7. {
  8. show desired pages
  9. }
Last edited by peter_budo; May 19th, 2009 at 7:40 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Poojasrivastava is offline Offline
13 posts
since Apr 2009
May 18th, 2009
0

Re: Displaying Pages Dynamic to users

Ya i also want to remove certain menus from the menu control, if the user logged in is admin.
Reputation Points: 8
Solved Threads: 3
Junior Poster
bharanidharanit is offline Offline
140 posts
since Nov 2008
May 19th, 2009
0

Re: Displaying Pages Dynamic to users

if thats the case then you just need to show the required pages..i mean its upto u what pages u want to give access to...to remove the menus simple dont show them...
i had a similar requirement but then i had a table maintained which user can access what menu...so based upon the query results i showed them the required pages!!
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Poojasrivastava is offline Offline
13 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Error opening word file from Asp.net
Next Thread in ASP.NET Forum Timeline: Dropdownlist in ASP.Net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC