sapp:
I am new to the concept of master pages and its controls. So can you please help me with the below doubt
How do i clear the selection history from a tree view?When i select a node and then close the browser and reopen it, the node is colored purple remembering my visits. How to clear this and make the tree look when i first visited.
Based on my experience, we can set CSS to the "A" tag to do this, see the following demo,
<%@ Page 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>
<style type="text/css">
A:link
{
color: #000000;
text-decoration: none;
}
A:visited
{
color: #000000;
text-decoration: none;
}
A:hover
{
color: #ff7f24;
text-decoration: underline;
}
A:active
{
color: #ff7f24;
text-decoration: underline;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="height: 100%">
<tr>
<td>
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="My Computer">
<asp:TreeNode Text="Favorites">
<asp:TreeNode Text="News">
<asp:TreeNode Text="MSN" NavigateUrl="http://www.msn.com" />
<asp:TreeNode Text="MSNBC News" NavigateUrl="http://www.msnbc.msn.com" />
</asp:TreeNode>
<asp:TreeNode Text="Technology">
<asp:TreeNode Text="Microsoft" NavigateUrl="http://www.microsoft.com" />
<asp:TreeNode Text="ASP.NET" NavigateUrl="http://www.asp.net" />
<asp:TreeNode Text="GotDotNet" NavigateUrl="http://www.gotdotnet.com" />
<asp:TreeNode Text="MSDN" NavigateUrl="http://msdn.microsoft.com" />
</asp:TreeNode>
<asp:TreeNode Text="Shopping">
<asp:TreeNode Text="MSN Shopping" NavigateUrl="http://shopping.msn.com" />
<asp:TreeNode Text="MSN Autos" NavigateUrl="http://autos.msn.com" />
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="City Links">
<asp:TreeNode Text="MapPoint" NavigateUrl="http://www.mappoint.com" />
<asp:TreeNode Text="MSN City Guides" NavigateUrl="http://local.msn.com" />
</asp:TreeNode>
<asp:TreeNode Text="Music Links">
<asp:TreeNode Text="MSN Music" NavigateUrl="http://music.msn.com" />
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>