Thursday, March 22, 2012

What is the best way to secure btns and/or textboxes on apsx pages

I'm just looking for any ideas or things other have done. I'm using memberships and profiles and would like to not let all users have access to all buttons and/or textboxes on some of the aspx page. Please share any ways you think I could do this (vb.net is possible).

If you need to have parts of page accessible to only some rolas:

- group all controls which belongs to same set of role into some container object ( asp:Panel )

- do Visible on/off of Panels in Page_Init / Page_Load depending on which role current user have


Hi

You set the visible property of the controls to false, if you don't wanna display the control or you can disable them based on their role.

It is some thing like

If

context.User.IsInRole("Member")Then

btnMember.Visible =

TrueElse

btnMember.Visible =

FalseEndIf

Good Luck

0 comments:

Post a Comment