Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

How to show different Button link for differenct user

by the3factory 5/10/2008 7:53:00 PM
Question:

My Main page is looks like follow

 

Top Frame     Button1  Button 2 Button 3 Button 4 Buttn 5

_______________________________________________________

Main Frame

 

the Button1 ~ Button5 clicked will direct to different page ( 1.aspx ~ 5.aspx )

and the 1.aspx ~5.aspx is show in Main Frame

 

suppose to I have 3 kinds of people will login to my system

Administator

SA

Guest

 

if Administrator loging will shows all of the 5 buttons

and Sa shows 4 of 5

Guest show 1 button

 

how to do that?

 

thank you very much


Answer1:

ASP.NET 2.0 Roles and maps files make it easy to do that per role. Read the article about it so you can understand the basics

You cannot go wrong with mr guthrie http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx

http://aspnet.4guysfromrolla.com/articles/120705-1.aspx Membership

Let me know after reading it if you got any questions.

 


Answer2:

Create 3 roles Administator, SA and Guest. Then check if the logged in user is in the SA role if so show button 4 & 5, if a user is not logged in at all or is guest only show button 1. If you set up a site map you can set the permissions in the XML file.


Answer3:

can you please give me more information about how to setting permissions in the XML file  ?

 and how to use XML file ? ( sorry but have no idea how to start...)

 

thank you very much 


Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0