Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Include tree view in every page

Include tree view in every page

Scheduled Pinned Locked Moved ASP.NET
phpcssdata-structureshelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    J Liang
    wrote on last edited by
    #1

    Hi, I am having a dilemma on what to do. Here is my situation. I have a website which every page will have a tree view on the left and the content on the right. I do not want to use iFrame or Frame as when I refresh, it will bring the user back to the main page and also some browser might not support frame. Another thing is the page title on the top left corner of the browser does not change when I go to another page with a different title. I wanted to have something like PHP's includes or something which can solve my above problem, I heard of CSS but CSS will still need me to include the tree view in every page by myself. I need some advice on this. Thanks in advance. J Liang

    M S 2 Replies Last reply
    0
    • J J Liang

      Hi, I am having a dilemma on what to do. Here is my situation. I have a website which every page will have a tree view on the left and the content on the right. I do not want to use iFrame or Frame as when I refresh, it will bring the user back to the main page and also some browser might not support frame. Another thing is the page title on the top left corner of the browser does not change when I go to another page with a different title. I wanted to have something like PHP's includes or something which can solve my above problem, I heard of CSS but CSS will still need me to include the tree view in every page by myself. I need some advice on this. Thanks in advance. J Liang

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      If you wanna do with ASP.NET, you can use Masterpage (2.0) or base class (1.1) to achieve. But with PHP, I would like to suggest you to read how to create Theme for Wordpress. < link >. As this forum is not for PHP, we are not able to give the exact code what you want.

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      J 1 Reply Last reply
      0
      • M Michael Sync

        If you wanna do with ASP.NET, you can use Masterpage (2.0) or base class (1.1) to achieve. But with PHP, I would like to suggest you to read how to create Theme for Wordpress. < link >. As this forum is not for PHP, we are not able to give the exact code what you want.

        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

        J Offline
        J Offline
        J Liang
        wrote on last edited by
        #3

        Hi Michael, Thanks for the reply. Yup, I'd search around the web and found out using Masterpage too. But I'm facing some problem, this is what I do. I have a master page Main.master and MainPage.aspx which MainPage.aspx suppose to be in Main.master. In MainPage.aspx, I added this <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainPage.aspx.cs" Inherits="MainPage" MasterPageFile="~/Main.master"%> Then I added whatever interface components I want in Main.master. But when I run it, I received this message Exception Details: System.Web.HttpException: Content controls have to be top-level controls in a content page or a nested master page that references a master page. Did I missed something? Thanks in advance. J Liang

        M 1 Reply Last reply
        0
        • J J Liang

          Hi Michael, Thanks for the reply. Yup, I'd search around the web and found out using Masterpage too. But I'm facing some problem, this is what I do. I have a master page Main.master and MainPage.aspx which MainPage.aspx suppose to be in Main.master. In MainPage.aspx, I added this <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainPage.aspx.cs" Inherits="MainPage" MasterPageFile="~/Main.master"%> Then I added whatever interface components I want in Main.master. But when I run it, I received this message Exception Details: System.Web.HttpException: Content controls have to be top-level controls in a content page or a nested master page that references a master page. Did I missed something? Thanks in advance. J Liang

          M Offline
          M Offline
          Michael Sync
          wrote on last edited by
          #4

          Masterpage ========== <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> Untitled Page

          ChildPage ========= <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %> Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

          J 1 Reply Last reply
          0
          • M Michael Sync

            Masterpage ========== <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> Untitled Page

            ChildPage ========= <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %> Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

            J Offline
            J Offline
            J Liang
            wrote on last edited by
            #5

            Hi Michael, Thanks, it works now. It was my child page's problem. When I add new item to the project, I should select 'Select Master Page' too. J Liang

            M 1 Reply Last reply
            0
            • J J Liang

              Hi, I am having a dilemma on what to do. Here is my situation. I have a website which every page will have a tree view on the left and the content on the right. I do not want to use iFrame or Frame as when I refresh, it will bring the user back to the main page and also some browser might not support frame. Another thing is the page title on the top left corner of the browser does not change when I go to another page with a different title. I wanted to have something like PHP's includes or something which can solve my above problem, I heard of CSS but CSS will still need me to include the tree view in every page by myself. I need some advice on this. Thanks in advance. J Liang

              S Offline
              S Offline
              Sven Cipido
              wrote on last edited by
              #6

              Hi, If you are using ASP.Net 2.0 you can use master pages to do this. A master page is a page in which the content stays the same for every page. On the masterpage itself you have a content place holder where all your other pages are comming.

              Sven Cipido (http://blog.svencipido.be)

              1 Reply Last reply
              0
              • J J Liang

                Hi Michael, Thanks, it works now. It was my child page's problem. When I add new item to the project, I should select 'Select Master Page' too. J Liang

                M Offline
                M Offline
                Michael Sync
                wrote on last edited by
                #7

                Okay.. good.. :)

                Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups