我页面上有一个treeview和一个datagrid 我想根据treeview的选择内容作为条件得到datagrid的内容,请问我如何再不刷新页面的情况下实现,是不刷新页面!!
谢谢各位,在下先谢过了!

解决方案 »

  1.   

    <%@ Page Language="vb" smartNavigation="false" AutoEventWireup="false" Codebehind="publicTreeNew.aspx.vb" Inherits="TMKM.publicleftNew" %>
    <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.116, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <title>ForumTree</title>
    <meta content="Microsoft Visual Studio .NET 7.0" name="GENERATOR">
    <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
    <meta content="VBScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <!-- #include file="../../css.css" -->
    </HEAD>
    <body leftMargin="0" topMargin="0" MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <table border="0" cellSpacing="0" cellPadding="0" width="100%">
    <tr valign="top">
    <td height="94" width="100%"><img src="../../Style0/Images/modulepicture/small/20.jpg" width="180" height="75"></td>
    </tr>
    <tr>
    <td width="33%" align="center">
    <table class="MenuItemMouseOver1" style="DISPLAY:none" cellSpacing="0" cellPadding="0"
    width="100%" border="0">
    <tr>
    <td align="center"><asp:linkbutton id="lbutTreeMenu1" style="DISPLAY: none;CURSOR: hand" Runat="server" CausesValidation="False"
    BorderWidth="0">所&nbsp;有</asp:linkbutton></td>
    </tr>
    </table>
    </td>
    <td width="33%" align="center">
    <table class="MenuItemMouseOver1" style="DISPLAY:none" cellSpacing="0" cellPadding="0"
    width="100%" border="0">
    <tr>
    <td align="center"><asp:linkbutton id="lbutTreeMenu2" style="DISPLAY: none;CURSOR: hand" Runat="server" CausesValidation="False"
    BorderWidth="0">常&nbsp;用</asp:linkbutton></td>
    </tr>
    </table>
    </td>
    <td width="33%" align="center">
    <table class="MenuItemMouseOver1" style="DISPLAY:none" cellSpacing="0" cellPadding="0"
    width="100%" border="0">
    <tr>
    <td align="center"><asp:linkbutton id="lbutTreeMenu3" style="DISPLAY: none;CURSOR: hand" Runat="server" CausesValidation="False"
    BorderWidth="0">权&nbsp;限</asp:linkbutton></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <TABLE id="Table1" cellSpacing="1" cellPadding="1" border="0">
    <TR>
    <TD width="100%" valign="top">
    <iewc:TreeView id="PublicTree" runat="server">
    <iewc:TreeNode Text="共享信息" ImageUrl="../../Style0/images/ico_dept.gif" Expanded="True" NodeData="MainContentNew.aspx"></iewc:TreeNode>
    <iewc:TreeNode Text="按部门分类" ImageUrl="../../Style0/images/ico_dept.gif" NodeData="MainContentNew.aspx"></iewc:TreeNode>
    <iewc:TreeNode Text="按时间分类" ImageUrl="../../Style0/images/ico_dept.gif" NodeData="MainContentNew.aspx"></iewc:TreeNode>
    <iewc:TreeNode Text="草稿箱" ImageUrl="../../Style0/images/ico_module.gif" NodeData="PublicListNew.aspx?FlowStatus=1&TypeID=-1"></iewc:TreeNode>
    <iewc:TreeNode Text="驳回文件夹" ImageUrl="../../Style0/images/ico_module.gif" NodeData="PublicListNew.aspx?FlowStatus=8&TypeID=-1"></iewc:TreeNode>
    <iewc:TreeNode Text="废弃文件夹" ImageUrl="../../Style0/images/ico_module.gif" NodeData="PublicListNew.aspx?FlowStatus=16&TypeID=-1"></iewc:TreeNode>
    <iewc:TreeNode Text="公共信息管理" ImageUrl="../../Style0/images/ico_module.gif" NodeData="setdepmanager.aspx"></iewc:TreeNode>
    </iewc:TreeView>
    </TD>
    </TR>

    </TABLE>
    </form>
    <script language="vbscript">
    parent.document.all.LeftTree.style.display ="block"
    function treeviewonclick()

    dim lngOUID,lngSubID,strSubName,strPath,strData,lngSubNameLen,strModuleID

    if PublicTree.getTreeNode(PublicTree.clickedNodeIndex).getAttribute("Expanded") = False then
    PublicTree.getTreeNode(PublicTree.clickedNodeIndex).setAttribute "Expanded","True"
    else
    PublicTree.getTreeNode(PublicTree.clickedNodeIndex).setAttribute "Expanded","False"
    end if

    strData = PublicTree.getTreeNode(PublicTree.clickedNodeIndex).getAttribute("NodeData")

    strSubName = Trim(PublicTree.getTreeNode(PublicTree.clickedNodeIndex).getAttribute("Text"))

    lngSubNameLen = Cstr(Len(Trim(strSubName)))
    'alert(strSubName)
    'alert(lngSubNameLen)

    strPath = "PublicNew/Skin0/"

    'If strSubName = "电子刊物" Then strModuleID = "NewDZKW"
    'If strSubName = "公司动态" Then strModuleID = "NewGSDT"
    'If strSubName = "通知公告" Then strModuleID = "NewTZGG"
    'If strSubName = "政策法规" Then strModuleID = "NewZCFG"
    'If strSubName = "规章制度" Then strModuleID = "NewGZZD"

    strModuleID = "<%=Session("ModuleID")%>"

    If InStr(strData, ";") > 0 Then
            lngSubID = Split(strData, ";")(0)
                lngOUID = Split(strData, ";")(1)
               
    If lngSubID <> 0 Then                
    parent.document.all.Main.src= strPath + "PublicListNew.aspx?OUID=" + lngOUID+ "&TypeID=" + lngSubID + "&UserID=" + lngSubID + "&lngSubNameLen=" + lngSubNameLen+ "&TypeName=" + strSubName
    Else
    if lngOUID > 20000 then
    parent.document.all.Main.src= strPath + "PublicListNew.aspx?OUID=" + lngOUID+ "&TypeID=-1"  + "&UserID=" + lngSubID + "&lngSubNameLen=" + lngSubNameLen+ "&TypeName=" + strSubName
    else
    parent.document.all.Main.src= strPath + "MainContentNew.aspx?ModuleID=" + strModuleID + "&Screen=" & screen.width & "*" & screen.height
    end if
    End If
    Else

    parent.document.all.Main.src= strPath + strData
            End If
           

    end function

    </script>
    </body>
    </HTML>最主要是function treeviewonclick()这个函数,单击树是调用它。然后导向新页面。
      

  2.   

    不刷新页面
    居然会这么要求,假如你的TreeView有一千个节点,你需要在XML里存多少东西