c# - Hiding ItemTemplate Controls within Formview -


currently code hiding panel(s) contained within itemtemplate of formview dependent on users role(s).

the current solution: ((panel)formview1.findcontrol("pnlisadmin")).visible = isadmin;

the problem code can't run until formview has been completed .databind();

now don't know formviews, surely there's way me hide controls such panel above in better place, , not dependent on .databind(); ( on page load )??

thanks information.

i don't mixing code-behind & display pages, wrap control in server tags:

<% if(isadmin){ %> <asp:panel id="pnlisadmin" runat="server"></asp:panel> <% } %> 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -