Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a web page with input buttons that should be displayed or hidden based on user-role permissions.

I'm currently using jquery to call a wcf service to get the valid control id's for the current user-role.  The wcf service returns the valid user control id's and I execute some jquery to display the matching controls to the user.

I'm wondering if there's a better way to implement this design in razor/webmatrix.

It seems like I can use HtmlHelper controls in razor/webmatrix but when I enter "@Html. " I see auto-complete for several controls like TextBox and CheckBox but no Button and no Div.

So what's the proper way to implement show/hide security for user role controls in razor/webmatrix?

It seems like show/hide functions in jquery is not the best way since js isn't secure.  It seems like HtmlControls could be used to control if a control is rendered to the browser or not.

Please let me know your opinion and experience with this.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900