Display all HTML elements based on Role - Need Optimized Solution

KillerPlatinum

New Member
I'm using ASP.Net for web development. I've situation here. say I've many HTML/ASP.Net controls on my page, and I've to set visibility of each control based on Logged-in user's role. for this I'm doing as follows:[*]Storing each Function-Name and Role combination is DB[*]During render, checking for role permission for each HTML/ASP.Net control. e.g: Displaying something like this:\[code\]<asp:Label runat="server" id="Lbl1" visible='<%=CheckVisibility("Display","Admin")%>'>public bool CheckVisibility(string FunctionName, string RoleName){ // checks for db entry and returns bool value}\[/code\]Problem is, I've to do this for all the Controls. Is there any other optimized approach available to do this? please help me
 
Back
Top