Include tree view in every page
-
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
-
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
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)
-
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)
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
-
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
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)
-
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)
-
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
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)
-
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
Okay.. good.. :)
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)