RT。
treeview中的节点是通过创建一个站点地图sitemap而绑定到其中的。在sitemap中为每个节点都指定了URL。 我在一个主页面中左边拖放了treeview控件,然后在右边定义了一个iframe<iframe id="contentinfo" src="User_Registe.aspx" name="content" frameborder="1" 
              width="660px" scrolling="no"   onload="javascript:heightframe();"></iframe>
求指教怎样实现左边导航右边显示对应页面。

解决方案 »

  1.   

    指定每个 treeview节点的 target属性对应到 iframe的name
    target="content"
      

  2.   

    最好是给整个页面一个框架<frameset rows="64,*"  frameborder="NO" border="0" framespacing="0">
    <frame src="Main_Top.aspx" noresize="noresize" frameborder="NO" name="topFrame" scrolling="no" marginwidth="0" marginheight="0" target="main" />
      <frameset cols="200,*"  rows="560,*" id="frame">
    <frame src="Main_Left.aspx" name="leftFrame" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" target="main" />
    <frame src="Main.aspx" name="main" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" target="_self" />
      </frameset>
     </frameset>
      

  3.   

    在哪设置呢, 我treeview中的Node在前台html页中根本就没用到,它的值都是从站点地图来的,中间通过一个sitemapdatasource控件绑定的。
      

  4.   

       我是直接在主页后台代码中遍历设置 treenode.target="content"  但貌似行不通
      

  5.   

    在treeview这个控件添加一个target属性,指向你所要显示的frame的名字
    如<treeview  target="content">
      

  6.   

    (jiangli198867)说的是正解,我试验后确定可行。代码如下:<body>
       <form id="form1" runat="server">
       
        <div id="head" class="head"  
            style="border-bottom-style:solid; border-bottom-color:Silver; left: 0px; width: 1280px; top: -1px; height:98px; position:absolute" >
            &nbsp;
            <asp:Label ID="Label1" runat="server" Text="校园危机管理系统" style="z-index: 100; left: 500px; position: absolute; top: 30px" Font-Size="XX-Large" Height="40px" Width="260px" BorderStyle="None"></asp:Label>
        </div>
        
        <div id="menu" class="menu"  style="border-right-style:solid; border-right-color:Silver; left: 0px; width: 300px; top: 101px; height:500px;position:absolute">
            <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" StartingNodeUrl="~/cmain.aspx" />
            
            <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" ExpandDepth="1"
                ShowLines="True" onselectednodechanged="TreeView1_SelectedNodeChanged" Target="note">   
            </asp:TreeView>
            
        </div>
        
        <div id="main" class ="main" style="height: 495px; width: 975px; top: 102px; left: 305px;  position:absolute">
            <iframe id="note" name ="note" src="xitongjieshao.aspx" width="100%" height="495" frameborder="0"  scrolling="yes"></iframe>
        </div>
       </form>
    </body>