Results 1 to 3 of 3

Thread: Hiding ASP.NET User Controls

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Location
    Reading
    Posts
    70

    Hiding ASP.NET User Controls

    Hi,

    I have an application that uses an ascx user control to show a header on a web page. This page gives the option to display the page in Excel, but when I do this I don't want the header to be there (there not in the web site any more so don't need the navigation).

    I thought it would be as simple as putting header.visible = false somewhere in my code, but alas it's not.

    Does anybody know how I can get round this?

    Cheers,

    AuldNick

  2. #2
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    Hi, actually that should work;

    I just used this piece of code to hide one of my user controls;

    VB Code:
    1. If Session("bAdmin") = 1 Then
    2.             UCAdmin1.Visible = False
    3.         End If

    Have you declared the user control in the code behind page??
    As in

    Protected withevents UCAdmin1 as UCAdmin

    hth
    Cheers
    MarkusJ

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Location
    Reading
    Posts
    70
    D'OH, Your right.

    Cheers Mate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width