asp.net - How can I display a gridview column only to users in a certain role? -
i have asp.net page gridview. make columns in gridview displayed if user in role, is, if httpcontext.current.user.isinrole(xxx) returns true.
what easiest way this?
i prefer solution can put in asp code , not in page code-behind.
i used technique in 1 of sites.
if roles.isuserinrole(profile.username, "this role") productgridview.columns(2).visible = false end if of course, in case 2 represents index of column hide.
Comments
Post a Comment