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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -