Tree Menu

Last post 12-02-2008 1:02 AM by dakreyi. 6 replies.

Sort Posts:

  • Tree Menu

    11-26-2008, 4:17 AM
    • Member
      2 point Member
    • dakreyi
    • Member since 11-21-2008, 7:24 PM
    • Posts 42

    I have a masterpage and a few pages. Ever since I added a tree Menu to the masterpage, the whole page including masterpage part gets reloaeded.

    Any help is appreciated.

    Thanks.

  • Re: Tree Menu

    11-30-2008, 10:26 PM

    dakreyi:

    I have a masterpage and a few pages. Ever since I added a tree Menu to the masterpage, the whole page including masterpage part gets reloaeded.

    Any help is appreciated.

    Thanks.


    Hi dakreyi,

    What do you mean?  Do you mean that you do not want to load the TreeView Menu for all pages?

    If so, you can refer this code,

    MasterPage.master:

     

    <%@ Master Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Demo</title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TreeView ID="TreeView1" runat="server">
                <Nodes>
                    <asp:TreeNode Text="A" Value="A"></asp:TreeNode>
                    <asp:TreeNode Text="B" Value="B"></asp:TreeNode>
                    <asp:TreeNode Text="C" Value="C"></asp:TreeNode>
                </Nodes>
            </asp:TreeView>
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
            
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>
    Default.aspx:
      
    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
    
    <script runat="server">
    
        protected void Page_Load(object sender, EventArgs e)
        {
           Page.Master.FindControl("TreeView1").Visible = false;
         }
    </script>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    </asp:Content>
    
     
      
    Hong-Gang Chen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Tree Menu

    12-01-2008, 1:37 AM
    • Member
      2 point Member
    • dakreyi
    • Member since 11-21-2008, 7:24 PM
    • Posts 42

     Hi Hong-Gang Chen

    Thanks for your help.

    Although I did not mean that, I was very happy for your reply since you have just taught me a very important thing.

    What I meant is: when navigate amnog pages, I would like to see that the Master page does not get refreshed with the pages (ContentPlaceHolder).

    That was the case, but since I added the TreeView, when I click on a url  to go to  another page, the master page content gets also reloded. 

    I would like to see only the content of pages get changed.

     Thanks again   

  • Re: Tree Menu

    12-01-2008, 4:58 AM

    dakreyi:

     Hi Hong-Gang Chen

    Thanks for your help.

    Although I did not mean that, I was very happy for your reply since you have just taught me a very important thing.

    What I meant is: when navigate amnog pages, I would like to see that the Master page does not get refreshed with the pages (ContentPlaceHolder).

    That was the case, but since I added the TreeView, when I click on a url  to go to  another page, the master page content gets also reloded. 

    I would like to see only the content of pages get changed.

     Thanks again   

    In such case, I think we can use UpdatePanel to solve this problem.  Say, put an iframe to an UpdatePanel, and assign the Target property as the iframe's ID, and assign the TreeView control as the trigger, and set the the trigger's event as "Changed", refer the following code,

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <iframe>
                </iframe>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged">
                </asp:AsyncPostBackTrigger>
            </Triggers>
        </asp:UpdatePanel>
     
    Hong-Gang Chen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Tree Menu

    12-01-2008, 5:48 AM
    • Member
      2 point Member
    • dakreyi
    • Member since 11-21-2008, 7:24 PM
    • Posts 42

    Hi,

    It is still the same.

    Thanks

  • Re: Tree Menu

    12-02-2008, 12:14 AM

    What about this one,

    http://www.codeplex.com/UFrame

    Hong-Gang Chen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Tree Menu

    12-02-2008, 1:02 AM
    • Member
      2 point Member
    • dakreyi
    • Member since 11-21-2008, 7:24 PM
    • Posts 42

    Sorry. I could not get it. Here is my masterpage. Please try to help.

    Thanks again.

    <%@ Master Language="VB" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title>MasterPages Demo</title><link href="StyleSheet.css" rel="stylesheet" type="text/css" />

     

    </head>

    <body leftmargin="0" topmargin="0" style="font-size: 10pt">

     

    <form id="form1" runat="server">

     

    <div>

    <table border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td colspan="2" style="border-bottom: olive thick solid; height: 60px; background-color: darkgray">

    <img align="absmiddle" src="Images/logo.gif" />

     

    <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Large"

    ForeColor="White" Height="31px" Style="z-index: 100; left: 740px; position: absolute;

    top: 20px; width: 424px;"></asp:Label>

    </td>

    </tr>

    <tr>

    <td colspan="1" style="width: 169px; height: 36px; border-bottom: silver thin solid; text-align: center;">

    <img src="Images/home.gif" /></td>

    <td colspan="1" style="height: 36px; width: 100%; border-bottom: silver thin solid;">

    <span style="font-size: 11pt; font-family: Verdana"><strong><em></em></strong></span></td>

    </tr><tr>

     

    <td style="vertical-align: top; width: 169px; height: 200px; background-color: lightgrey">

     

     

     

     

    <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource2" ImageSet="News" NodeIndent="10" Font-Underline="False">

    <ParentNodeStyle Font-Bold="False" />

    <HoverNodeStyle Font-Underline="False" BackColor="#FFFF80" />

    <SelectedNodeStyle Font-Underline="True" Font-Bold="True" />

    <NodeStyle Font-Names="Arial" Font-Size="10pt" ForeColor="Black" HorizontalPadding="5px"

    NodeSpacing="0px" VerticalPadding="0px" />

    </asp:TreeView>

     

     

     

    <img alt="" src="Images/krg.jpg" style="width: 70px; height: 58px; top: 0px; left: 1190px; position: absolute; margin-top: 0px" />

     

    </td>

    <td style="vertical-align: top">

     

    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

    </asp:ContentPlaceHolder>

    <asp:LoginStatus ID="LoginStatus2" runat="server" BackColor="#E0E0E0" BorderStyle="Outset"

    Font-Bold="True" Font-Underline="False" ForeColor="Blue" LogoutPageUrl="~/logIn.aspx"

    Style="z-index: 100; left: 500px; position: absolute; top: 88px"

    LogoutAction="Redirect" />

    </td>

    </tr>

    <tr>

    <td colspan="2" style="height: 40px">

    Copyright © 2005 KRG</td>

    </tr>

    </table>

    </div>

    <asp:SiteMapDataSource ID="SiteMapDataSource2" runat="server" />

    </form>

    </body>

    </html>

Page 1 of 1 (7 items)