Unload web user control dynamically (I am using the control for menu purpose)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sank06
    New Member
    • Dec 2006
    • 7

    Unload web user control dynamically (I am using the control for menu purpose)

    I am using 2 web controls (for header menu)

    if the user is admin, I want to load web1.ascx else
    web2.ascx.

    At the start of the page, I have added this

    Code:
    <%@ Register Src="web1.ascx" TagName="web1Control" TagPrefix="uc2" %>
    Do i have to add the other control as well?


    I am clueless. pl help me.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    I would add both controls to the page and use the Visible property to set which one is displayed. When you set the Visible property of a user control to False in your C# or VB.NET code, it will not render the control in the page at all.

    -Frinny

    Comment

    Working...