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,
dakreyi
Member
2 Points
42 Posts
Tree Menu
Nov 26, 2008 08:17 AM|LINK
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.
Hong-Gang Ch...
All-Star
74696 Points
6768 Posts
Re: Tree Menu
Dec 01, 2008 02:26 AM|LINK
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>If you have any feedback about my replies,please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
dakreyi
Member
2 Points
42 Posts
Re: Tree Menu
Dec 01, 2008 05:37 AM|LINK
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
Hong-Gang Ch...
All-Star
74696 Points
6768 Posts
Re: Tree Menu
Dec 01, 2008 08:58 AM|LINK
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>If you have any feedback about my replies,please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
dakreyi
Member
2 Points
42 Posts
Re: Tree Menu
Dec 01, 2008 09:48 AM|LINK
Hi,
It is still the same.
Thanks
Hong-Gang Ch...
All-Star
74696 Points
6768 Posts
Re: Tree Menu
Dec 02, 2008 04:14 AM|LINK
What about this one,
http://www.codeplex.com/UFrame
If you have any feedback about my replies,please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
dakreyi
Member
2 Points
42 Posts
Re: Tree Menu
Dec 02, 2008 05:02 AM|LINK
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>