Hello,
I'm attempting to use a radTreeView for navigation in a Master page. Each link navigates to a content page. The items are static in the html code, not loaded at runtime. I can't seem to save the state between pages. I'm using the code below, I didn't paste in the entire tree. Can someone point me in the right direction.
I am using node templates with links if it makes a difference.
I'm attempting to use a radTreeView for navigation in a Master page. Each link navigates to a content page. The items are static in the html code, not loaded at runtime. I can't seem to save the state between pages. I'm using the code below, I didn't paste in the entire tree. Can someone point me in the right direction.
telerik:RadTreeView ID="RadTreeView1" Runat="server" |
EnableAjaxSkinRendering="False" ShowLineImages="False" |
SingleExpandPath="True" EnableEmbeddedSkins="False" |
Skin="MySkin" OnClientNodeClicked="ClientNodeClicked" OnNodeExpand="RadTreeView1_NodeExpand" |
onnodecollapse="RadTreeView1_NodeCollapse"> |
protected void Page_Load(object sender, EventArgs e) |
{ |
if (!Page.IsPostBack && String.IsNullOrEmpty((string)Session["myTreeView"])) |
{ |
Session["myTreeView"] = RadTreeView1.GetXml(); |
} |
else if (!String.IsNullOrEmpty((string)Session["myTreeView"]) && (!IsPostBack)) |
{ |
string treeViewState = (string)Session["myTreeView"]; |
RadTreeView1.LoadXmlString(treeViewState); |
} |
} |
protected void RadTreeView1_NodeExpand(object sender, RadTreeNodeEventArgs e) |
{ |
Session["myTreeView"] = RadTreeView1.GetXml(); |
} |
<telerik:RadTreeNode runat="server" |
HoveredImageUrl="~/images/plus.jpg" |
ImageUrl="~/images/node-image.gif" Width="165px" > |
<NodeTemplate> |
<a href="ContactUs.aspx">Contact Us</a> |
</NodeTemplate> |
</telerik:RadTreeNode> |