c# - Dynamically hiding web parts based on current user roles -


how can dynamically hide/show web-parts in asp.net. using this doing same , in article have hard coded roles on authorizationfilter attribute of control , instead want roles should assigned @ runtime. have tried alternate , have declare variable 'roles' in .cs file , @ runtime assigning values roles variable( , using authorizationfilter='<%# roles %>' ) doesn't work me each time getting value authorizationfilter blank*(if using text='<%# roles %>'* on label displays value value not assign authorizationfilter). have tried

     if (user.isinrole("admin"))         label2.visible = true; 

but still display web part title inside web part zone.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -