找不到事件的入口?大家都怎么使用treeview控件呢?
解决方案 »
- 如何在MOSS中启用Session功能
- xmlNodeList 怎么取其中的一部分。
- 关于弹出提示框的问题~
- 经典!
- 如何在网页中判断网页中嵌入的某个自定义ActiveX控件已注册过
- 动态生成了datagrid的列,但是一绑定数据源列就把表中所有的列显示出来了
- 一个编辑命令行的问题
- 如何將以下javascript語句改為vbscript語句?
- 各位高手:请问如何通过连接数据库生成非实时目录树菜单,就象本论坛的形式!急,急!
- 怎样实现点击提交按钮后自动跳到指定的aspx页面?我写了一个但不行(附源码)?
- 关于取得网页中的内容的方法
- 关于DataTable导出数据到EXCEL文件并下载与页面间传值的问题
.net中Page_load加
TreeView1.Attributes.Add("onclick","GetAttribute()");页面加
<script language="javascript">
function GetAttribute()
{
document.Form1.txtDescription.value='';
document.Form1.txtTypeID.value=Trim(TreeView1.getTreeNode(TreeView1.clickedNodeIndex).getAttribute("ID"));
document.Form1.txtTypeName.value=Trim(TreeView1.getTreeNode(TreeView1.clickedNodeIndex).getAttribute("Text"));
document.Form1.txtDescription.value=Trim(TreeView1.getTreeNode(TreeView1.clickedNodeIndex).getAttribute("NodeData"));
}
</script>2.用SelectIndexChange
#region 双击tree
public void trvModel_DblClick()
{
string myFlag;
try
{
string strIndex = TreeIndex.Value;
TreeNode myNode = null;
myNode=TreeView1.GetNodeFromIndex(strIndex);
string myTreeNodeText=myNode.ID.Trim();
mySystemPlanID=myNode.ID.Trim();
Session["myBigCode"]=myTreeNodeText.Trim();
Session["mySessionPlanGroupAudit"]=myTreeNodeText.Trim();
myTreeID=myTreeNodeText.Trim();
myTempSystemDemandID=myTreeID;
reader=LoginStruct.GetReaderValue(myTreeNodeText);
myFlag=NoDataAccess.GetSubstringRealLength(myTreeNodeText);
TreeNode mySubNode;
if (myFlag=="2")
{
if(myNode.Nodes.Count==0)
{
while(reader.Read())
{
mySubNode=new TreeNode();
mySubNode.ID=reader["MIDDLECODE"].ToString();
mySubNode.Text=reader["MIDDLECODE"].ToString()+"||"+reader["MIDDLENAME"].ToString();
myNode.Nodes.Add(mySubNode);
}
}
myNode.Expanded=true;
//RefushPage();
//mySubNode=new TreeNode();
//mySubNode.NavigateUrl="EditParticularCode.aspx?BIGCODE='"+myTreeID+"'" ;
//mySubNode.Target ="main";
}
if (myFlag=="4")
{
myTreeNodeText=myNode.ID;
reader=LoginStruct.GetSmallReaderValue(myTreeNodeText);
if(myNode.Nodes.Count==0)
{
while(reader.Read())
{
mySubNode=new TreeNode(); mySubNode.ID=reader["SMALLCODE"].ToString();
mySubNode.Text=reader["SMALLCODE"].ToString()+"||"+reader["SMALLNAME"].ToString();
myNode.Nodes.Add(mySubNode);
}
myNode.Expanded=true;
}
//mySubNode=new TreeNode();
//mySubNode.NavigateUrl="EditParticularCode.aspx?MIDDLECODE='"+myTreeID+"'" ;
//mySubNode.Target ="main";
RefushPage();
}
if (myFlag=="6")
{
myTreeNodeText=myNode.ID;
reader=LoginStruct.GetParticularReaderValue(myTreeNodeText);
if(myNode.Nodes.Count==0)
{
while(reader.Read())
{
mySubNode=new TreeNode();
mySubNode.ID=reader["MATERIALCODE"].ToString();
mySubNode.Text=reader["MATERIALCODE"].ToString()+"||"+reader["MATERIALNAME"].ToString();
myNode.Nodes.Add(mySubNode);
}
myNode.Expanded=true;
}
RefushPage();
}
if (myFlag=="2")
{
Response.Write("<script>parent.main.window.location='EditParticularCode.aspx';</script>");
Response.Write("<script>parent.main.document.all.TextBox9.value='"+myTreeNodeText+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox11.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox2.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox5.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox7.value='';</script>");
Response.Write("<script>parent.main.document.all.TextBox12.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox3.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox4.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox6.value='';</script>");
}
if (myFlag=="4")
{
string[] myRobin = new string[4];
LoginStruct.ResultThreeValue(3,myTreeNodeText);
myRobin[0]=LoginStruct.myRobin[0];
myRobin[1]=LoginStruct.myRobin[1];
myRobin[2]=LoginStruct.myRobin[2];
myRobin[3]=LoginStruct.myRobin[3];
Response.Write("<script>parent.main.document.all.TextBox9.value='"+myRobin[0]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox11.value='"+myRobin[1]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox2.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox5.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox7.value='';</script>");
Response.Write("<script>parent.main.document.all.TextBox12.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox3.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox4.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox6.value='';</script>");
}
if (myFlag=="6")
{
string[] myRobin = new string[5];
LoginStruct.ResultThreeValue(4,myTreeNodeText);
myRobin[0]=LoginStruct.myRobin[0];
myRobin[1]=LoginStruct.myRobin[1];
myRobin[2]=LoginStruct.myRobin[2];
myRobin[3]=LoginStruct.myRobin[3];
myRobin[4]=LoginStruct.myRobin[4];
Response.Write("<script>parent.main.document.all.TextBox9.value='"+myRobin[0]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox11.value='"+myRobin[1]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox2.value='"+myRobin[2]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox5.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox7.value='';</script>");
Response.Write("<script>parent.main.document.all.TextBox12.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox3.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox4.value='';</script>");
Response.Write("<script>parent.main.document.all.Textbox6.value='';</script>");
}
if (myFlag=="9")
{
string[] myRobin = new string[9];
LoginStruct.ResultThreeValue(5,myTreeNodeText);
myRobin[0]=LoginStruct.myRobin[0];
myRobin[1]=LoginStruct.myRobin[1];
myRobin[2]=LoginStruct.myRobin[2];
myRobin[3]=LoginStruct.myRobin[3];
myRobin[4]=LoginStruct.myRobin[4];
myRobin[5]=LoginStruct.myRobin[5];
myRobin[6]=LoginStruct.myRobin[6];
myRobin[7]=LoginStruct.myRobin[7];
myRobin[8]=LoginStruct.myRobin[8];
Response.Write("<script>parent.main.document.all.TextBox9.value='"+myRobin[0]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox11.value='"+myRobin[1]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox2.value='"+myRobin[2]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox5.value='"+myRobin[3]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox7.value='"+myRobin[4]+"';</script>");
Response.Write("<script>parent.main.document.all.TextBox12.value='"+myRobin[5]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox3.value='"+myRobin[6]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox4.value='"+myRobin[7]+"';</script>");
Response.Write("<script>parent.main.document.all.Textbox6.value='"+myRobin[8]+"';</script>");
}
}
catch
{
return;
}
NoDataAccess.GetFormValue(mySystemPlanID);
SendValueForm();
}
#endregion
<!--
function TrvModel_DblClick(tree)
{
window.document.Form1.Isdbclick.value="true";
var node=tree.getTreeNode(tree.clickedNodeIndex);
document.Form1.TreeIndex.value = tree.clickedNodeIndex;
window.document.Form1.submit();
}
-->
</script>
</HEAD>
{ .....}
if (myFlag=="4")
{
......
}
是什么意思? 学习。看不懂。先收藏!