ASP.NET + Content Pane's and Loading User Control

Posted on 2004-11-28
Last Modified: 2008-02-01
i want to create a page using where i have 2 panes, once the user logins in, the left pane will hold a list of links (linkbuttons) that when they click on one it will load a user control into the main pane.  The links list pane is also a user control, is this possible?  and if so how would i do it, i tried putting the code to load the control into the main pane but that didn't work.

Question by:dkilby
    LVL 28

    Expert Comment

    Hi dkilby,

    you have to choose some way of understaning if a user control ( within main pane ) should be visible or not
    this you can perform:
    1. if your links are HyperLink controls - by sending some querystring parameters
    2. if your links are LynkButton controls - give them one event hadler for onclick event and set the CommandName of each control to different values. then within this event hadler you will know which Linkbutton was pressed and which user control within the main pane to show


    Author Comment

    i have my default.aspx page with 2 panes, left and content.  if the user is not authenticated then in the left pane the login.ascx user control will load. If they are authenticaed the the menu.ascx user control will load.  The menu.ascx control contains link buttons.  I tried loading a different control into the main content pane on default.aspx from the menu.ascx, but i can't get it to work.

            If Request.IsAuthenticated = False Then
                LeftPane.Visible = True
                LeftPane.Visible = True
            End If


        Private Sub lnk_csrsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnk_csrsearch.Click
            ContentPane.Visible = True
        End Sub

    I get the errror "Name 'ContentPane' is not declared."  
    LVL 35

    Accepted Solution

    Private Sub lnk_csrsearch_Click does not recognize ContentPane

    try this:

     Private Sub lnk_csrsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnk_csrsearch.Click
    dim cp as Control

    if not cp is nothing then
            cp.Visible = True

    end if
        End Sub

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now