各位大侠,我弄了一个Treeview控件在页面上
节点信息都是从数据库读取出来显示的,页面
加载时,默认节点是没有展开的,在本地机器
上运行是没有出现什么问题,但是我把项目发
到服务器上时,节点的那个“+”没有了,变成
了“展开 什么“ 点击之后没有任何效果,麻烦
各位大侠帮我看一下急啊。不管问题有没有解决先谢谢各位啦。。!!!
.NET3.5的
节点信息都是从数据库读取出来显示的,页面
加载时,默认节点是没有展开的,在本地机器
上运行是没有出现什么问题,但是我把项目发
到服务器上时,节点的那个“+”没有了,变成
了“展开 什么“ 点击之后没有任何效果,麻烦
各位大侠帮我看一下急啊。不管问题有没有解决先谢谢各位啦。。!!!
.NET3.5的
这个是典型的treeview的图片目录没有加入.那个+应该是个小图标.没有找到时会显示alt的方文字内容.
> 点击之后没有任何效果
这个应该就是数据问题了.当然也可能是treeview的js目录没有加入,导致页面不知道要做什么.建议仔细看一下treeview控件的详细配置.
<table>
<tr>
<td valign=top>
<asp:TreeView ID="TreeView1" runat="server" ExpandDepth="0">
</asp:TreeView>
<asp:TreeView ID="TreeView2" runat="server" ExpandDepth="0">
</asp:TreeView>
</td>
<td class="style1" align = "center">
<table align = "center">
<tr>
<td align = "center">
<asp:ContentPlaceHolder ID="ChindContent" runat="server"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Content>
{
if (!Page.IsPostBack)
{
addProduct();
addProqram();
}
} public void addProduct()
{
TreeNode tr = new TreeNode();
tr.Text = "产 品";
string sql = "select * from product";
OleDbDataAdapter oa = db.selectAll(sql);
DataSet d = new DataSet();
oa.Fill(d, "product");
for (int i = 0; i < d.Tables["product"].Rows.Count; i++)
{
TreeNode cn = new TreeNode();
cn.Text = d.Tables["product"].Rows[i]["p_name"].ToString();
int id = Convert.ToInt32(d.Tables["product"].Rows[i]["p_id"]);
cn.NavigateUrl = "~/productInformation.aspx?p_id=" + id;
tr.ChildNodes.Add(cn);
}
TreeView1.Nodes.Add(tr);
}后台代码