SelectedIndexChange
凑合着当单击用吧
凑合着当单击用吧
解决方案 »
- 问个Gridview数据显示长度的问题,感觉代码没什么问题呀。。
- 难题
- datalist的数据绑定
- 有关PetShop中的SQLServerDAL中的一个问题??
- 急!!!!实在是没分了!!asp.net 如何实现对项目加密的功能
- 关于web.config的问题。
- .aspx页面中把datagrid中的数据下载为word文挡时提示:类型“CheckBox”的控件“DataGrid1__ctl3_check1”必须放在具有 runat=server 的
- 网页上面的图片,有的时候不能正确显示!必须刷新一下才能显示,不知道为什么?
- 各位高手,请教一个从datagrid中删除数据的问题!!!在线等
- 刚刚开始学习Asp。net,请教各位大哥一个问题,下面程序错在哪里?
- 这个问题有没有答案?
- 公司遇到问题,想自己编一套人事管理系统,想知道其可行性有多少(详细见内,参与者有分)
可否说的详细些,近来也在狂掰treeview,也许可以帮你!
在此声讨ms的treeview,不成熟啊!
Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs e)
{
}
别忘了。AutoPostBack属性为真
<xsl:for-each select="section"> <xsl:element name="TreeNode"> <xsl:attribute name="Text"><xsl:value-of select="@display"/></xsl:attribute> <xsl:attribute name="NavigateURL"><xsl:value-of select="concat('javascript:queryBySection("',@name,'")')"/></xsl:attribute> </xsl:element>
</xsl:for-each>
http://msdn.microsoft.com/workshop/webcontrols/behaviors/library/treeview/treeview_client_ovw.asp
function myFunction(){
var oldIndex= window.event.oldTreeNodeIndex;
var newIndex= window.event.newTreeNodeIndex;
alert("The value of the oldTreeNodeIndex property is " + oldIndex +
"\nThe value of the newTreeNodeIndex property is " + newIndex);
}</SCRIPT><mytree:TREEVIEW ID="oTree" ONSELECTEDINDEXCHANGE=myFunction() >
<mytree:TREENODE TEXT="Michigan">
<mytree:TREENODE TEXT="Detroit"/>
<mytree:TREENODE TEXT="Farmington"/>
<mytree:TREENODE TEXT="Southfield" />
</mytree:TREENODE>
<mytree:TREENODE TEXT="Washington">
<mytree:TREENODE TEXT="Bellevue"/>
<mytree:TREENODE TEXT="Redmond"/>
<mytree:TREENODE TEXT="Seattle"/>
</mytree:TREENODE>
</mytree:TREEVIEW>
1.首先创建空白页 wfmAbout.aspx 指向wfmAboutDisplay.aspx页面
----------------------------------------------------------
<iframe name="I1" align="top" hspace="0" vspace="0" src="wfmAboutDisplay.aspx" frameBorder="0" width="778" scrolling="yes" height="100%" style="WIDTH: 778px; HEIGHT: 74%">
</iframe>
2.wfmAboutDisplay.aspx这也是一个空白页,是为了转向所定义的两帧
wfmAboutLeft.aspx和wfmAboutRightDisplay.aspx,其中wfmAboutLeft.aspx是TreeView所在的页面,wfmAboutRightDisplay.aspx是一个跳转页面或是你键入此地址的默认页面.
----------------------------------------------------------
<frameset cols="136,635">
<frame src="wfmAboutLeft.aspx" scrolling="no" noresize frameborder="0" name="leftone">
<frame src="wfmAboutRightDisplay.aspx frameborder="no" name="rightone"> // 用来命名触发TreeView所致向的目标
</frameset>
3.设定左帧wfmAboutLeft.aspx 调用TreeView,ID = TreeViewAboutLeft
--------------------------------------------------------
前台代码:
<iewc:treeview id="TreeViewAboutLeft" runat="server" SelectExpands="True" Height="100%" width="136" AutoSelect="True" AutoPostBack="false"></iewc:treeview>
后台代码:(作个摘要,最关键的已经列出,代码太长了,贴不完了)
public class wfmAboutLeft : System.Web.UI.Page
{
protected Microsoft.Web.UI.WebControls.TreeView TreeViewAboutLeft;private void dgPageBind()
{
string strSelIndex="0";
string strCondbMemorabilia=clsCommon.strCondbMemorabilia;
string strSql="select cnilistID,cnvcListName,cnvcLink,cniNodeLink from tbAboutList order by cniListID asc"; clsCommon clsNode=new clsCommon();
DataSet dsNode=clsNode.GetData(strCondbMemorabilia,strSql); if(Convert.ToInt32(dsNode.Tables["ErrorTable"].Rows[0]["cniErrorID"])==1)
{
DataTable dtNode=dsNode.Tables["dtRetu"];
int kNodeCount=dtNode.Rows.Count;
for (int k=0;k<kNodeCount;k++)
{
TreeNode node0=new TreeNode();
node0.Text=dtNode.Rows[k]["cnvcListName"].ToString();
node0.NavigateUrl=dtNode.Rows[k]["cnvcLink"].ToString();
node0.Target="rightone";
TreeViewAboutLeft.Nodes.Add(node0); //进入TreeView的第二层循环,加入是“集团简介”这个节点
if(Convert.ToInt32(dtNode.Rows[k]["cniNodeLink"]) ==1)
{
string strCondbUserInfo=clsCommon.strCondbUserInfo;
string strSqlUserInfo="select cncBlockID,cnvcBlockCName,cnvcBlockCName2 from tbBlock order by cncBlockID asc"; clsCommon clsFirstNode=new clsCommon();
DataSet dsFirstNode=clsNode.GetData(strCondbUserInfo,strSqlUserInfo); if(Convert.ToInt32(dsFirstNode.Tables["ErrorTable"].Rows[0]["cniErrorID"])==1)
{
DataTable dtFirstNode=dsFirstNode.Tables["dtRetu"];
int iNodeCount=dtFirstNode.Rows.Count;
string temNodeID;//设置公司所属板块入口 for (int i=0;i<iNodeCount;i++)
{
if(Convert.ToInt32(dtFirstNode.Rows[i]["cncBlockID"].ToString())<10)
{
TreeNodeCollection tnc0=node0.Nodes;
TreeNode node1=new TreeNode();
temNodeID=dtFirstNode.Rows[i]["cncBlockID"].ToString();
node1.Text=dtFirstNode.Rows[i]["cnvcBlockCName2"].ToString();
node1.NavigateUrl=@"wfmAboutRightDisplay.aspx?strSelIndex="+Convert.ToString(strSelIndex);
strSelIndex=Convert.ToString(Convert.ToDouble(strSelIndex)+0.1);
node1.Target="rightone";
tnc0.Add(node1);
//进入TreeView的第三层循环,列出板块下各子公司
string strCondbAboutCompany=clsCommon.strCondbUserInfo;
string strSqlAboutCompany="select cncCompanyID,cnvcCompanyCName,cnvcCompanyCName2 from tbCompany where cncBlockID='"+temNodeID+"' order by cntiComDispOrder asc";
clsCommon clsSecondNode=new clsCommon();
DataSet dsSecondNode=clsSecondNode.GetData(strCondbAboutCompany,strSqlAboutCompany);
if(Convert.ToInt32(dsSecondNode.Tables["ErrorTable"].Rows[0]["cniErrorID"])==1)
{
DataTable dtSecondNode=dsSecondNode.Tables["dtRetu"];
int mSecondNodeCount=dtSecondNode.Rows.Count; for(int m=0;m<mSecondNodeCount;m++)
{
TreeNodeCollection tnc1=node1.Nodes;
TreeNode node2=new TreeNode(); node2.Text=dtSecondNode.Rows[m]["cnvcCompanyCName2"].ToString();
node2.NavigateUrl=@"Brief/wfmAboutBriefCompany.aspx?cncCompanyID="+Convert.ToString(dtSecondNode.Rows[m]["cncCompanyID"])+"&cnvcCompanyCName="+Convert.ToString(dtSecondNode.Rows[m]["cnvcCompanyCName"]);
node2.Target="rightone";
tnc1.Add(node2);
}
}
//结束TreeView的第三层循环
}
}
}....
4.设立右帧,也就是你指向的页面地址了!
就是设置treeNode所影响的框架
这样点击目录树结点,就能使右面框架重定向