易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net treeview绑定数据库,并取节点和节点的内容

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AlltripDLL;
public partial class visa_tree : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindtree(0);
        }
      
    }
    public void bindtree(int id)
    {
        treeclass tree = new treeclass();
        DataTable ds = tree.selectnode(id);
        for (int i = 0; i < ds.Rows.Count; i++)
        {
            TreeNode node = new TreeNode();
            node.PopulateOnDemand =false;
            node.Text = ds.Rows[i]["nodesname"].ToString();
            node.Value = ds.Rows[i]["nodesid"].ToString();
            TreeView1.Nodes.Add(node);
            //node.NavigateUrl = "list.aspx";
            node.SelectAction = TreeNodeSelectAction.Expand;
            bingChildnodes(node);
        }
    }


相关文档:

使用ASP.NET的权限系统

1. 生成aspnet的权限数据表和sp,使用.net 2.0的命令如下:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql -W
使用-W参数调出连接数据库向导,根据向导生成数据库数据。
2. 在web.config更改验证方式并添加providers
<configuration>
<connectionStrings>
<add name="dbConn ......

C# asp.net中字符串数组去重

 public static void Purge(ref List<string>needToPurge)
        {
           
            for(int i=0;i<needToPurge.Count-1;i++)
 &n ......

提高ASP.NET应用程序的性能

1、基于ASP.NET技术的页面缓存
  基于ASP.NET技术的页面缓存,通常有如下两种应用方式:
  一、基于数据库触发(设置缓存依赖策略,当数据库中数据发生变化时,触发缓存失效;但微软提供的解决方案目前仅支持SQL Server,如果是ORACLE需要自己实现触发接口)。
  二、基于文件依赖的策略(可以设置缓存依赖于文件中的具 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号