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++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -