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);
}
}
相关文档:
public static void Purge(ref List<string>needToPurge)
{
for(int i=0;i<needToPurge.Count-1;i++)
&n ......
ASP.NET中前台javascript与后台代码调用
2010-03-31 10:01
.net中C#代码与javaScript函数的相互调用问题。
问:
1.如何在JavaScript访问C#函数?
2.如何在JavaScript访问C#变量?
3.如何在C#中访问JavaScript的已有变量?
4.如何在C#中访问JavaScript函数?
问题1答案如下:
javaScript函 ......
验证码控件WebValidates的使用步骤如下:
1. 将验证码控件放入工具箱。(直接拖动DLL放到工具箱即可)
2. 拖放控件到页面相应位置。
3. 页面初始化时,编程生成验证码(假设验证码控件ID为snCode)。
snCode.Create();//首次加载生成新验证码
4. 编码对比用户的输入(假设用户输入验证码的文本框ID是txtCode ......
asp.net
http://topic.csdn.net/t/20060818/14/4959087.html
http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm
http://dotnet.aspx.cc/ShowDetail.aspx?id=149E5DD7-3B32-461e-ACC6-51D1652E6746
http://www.xueit.com/html/2009-08/21_4321_00.html
http://topic.csdn.net/t/20060429/10/4722766.html
......
点击按钮上传FileUpload的图片
protected void Button3_Click(object sender, ImageClickEventArgs e)
{
if (FileUpload1.HasFile)
{
&nbs ......