I have a page with a web user control, this one is quite heavy and he is used only if the application user have some rights. So he is set to visible = false in case of user can’t use it.. But in this case the control is added to page even he is not visible.
The problem is the web user control is used really Rarely. So I would like to not include code if this is not necessary.
I feel I have to use the preinit state to add the web user control when it is necessary but I don’t know how..
Any good idea? Thanks for help..
add it in the code behind with LoadControl, eg. put PlaceHolder on that aspx page and then load it from the code, like this