Change a page based on a user's profile.

I am looking for best practices or a solution on how to change a page based on a logged in users profile.  I am able to authenticate users against our LDAP and pull their group membership information, however, what is the best way to change the page based on their group membership information.  For example, I have a set of buttons, and only certain user groups should see certain buttons.  I am not sure of the best way to proceed.  My application is written in C# with a SQL server back end.  

shanemayAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pr0t0c0l12Commented:
Use trimming principles.  Here you can find some good help about trimming based on the user's roles, rights...
This time tracker has trimming enabled and it is just perfect for what you want to do...

http://www.asp.net/downloads/starter-kits/time-tracker/

Download them and try it.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dwaynecharringtonCommented:
I'm not sure how C# exactly works but with principle couldn't you simple use variables and change their data with an SQL query?

I mean structure the page as you would. Perform an SQL query with the user id of the logged in user or through the url. Put some variables in the page and set their data to that of your query.

Sorry if this is completely useless to you, or doesn't make much sense.
pr0t0c0l12Commented:
This is VB code but surely gives you a baseline to start on your c# code.  You might ask in their forums to see if they have the c# version.  

Overall asp.net will let you control what you want users to see based on their permissions and roles.
BTosonCommented:
I would just have a standard set of buttons on the page and change their visibility in the code behind based on the user's role using a switch or something
Some of these methods can also be used to ensure that when a user accesses a function they actually have permission to.
switch (rolename){
	case "administrator":
		//show relevant buttons for administrator
		break;
	case "user":
		//show relevant buttons for user
		break;
	default:
		//fall through
		break;
}

Open in new window

shanemayAuthor Commented:
Thank you for the feedback and advice.  
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.