日期:2014-05-17 浏览次数:20545 次
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
TreeView1.SelectedNodeStyle.ForeColor = Color.Blue; }
A:link {
COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
COLOR: #000000; TEXT-DECORATION: none
}
A:hover {
COLOR: #DD5555; TEXT-DECORATION: none
}
A:active {
COLOR: #DD5555; TEXT-DECORATION: none;
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TreeView.aspx.cs" Inherits="Galsun.Test.Web.TreeView" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<script>
var preNode;
function selval(obj, url, target) {
//alert(obj.innerHTML);
/*
var cb = obj.parentNode.parentNode.getElementsByTagName("input");
if (cb.length > 0)
cb[0].checked = true;
document.getElementById("<%= txt_path.ClientID %>").value = obj.innerHTML;
*/
if (preNode) preNode.style.color = "";
obj.style.color = "#FF0000";
preNode = obj;
//document.getElementById("<%= txt_path.ClientID %>").value = obj;
window.open(url, target);
}
</script>
<body>
<form id="form1" runat="server" >
<div>
<asp:TextBox ID="txt_path" runat="server" Width="422px"></asp:TextBox>
<asp:TreeView ID="TreeView1" runat="server" ImageSet="XPFileExplorer"
NodeIndent="15">
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black"
HorizontalPadding="2px" NodeSpacing="0px" VerticalPadding="2px" />
<ParentNodeStyle Font-Bold="False" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False"
HorizontalPadding="0px" VerticalPadding="0px" />
</asp:TreeView>
<iframe name="Rig