treeview(sitemap)+iframe构造左边导航右边显示对应页面的布局

随性锁欲 2011-10-18 08:55:21
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>

求指教怎样实现左边导航右边显示对应页面。
...全文
357 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
feidinan1944 2012-08-08
  • 打赏
  • 举报
回复
(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" >
 
<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>
jiang*l 2012-03-05
  • 打赏
  • 举报
回复
在treeview这个控件添加一个target属性,指向你所要显示的frame的名字
如<treeview target="content">
andylei0145 2011-10-19
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 hgfliubin123 的回复:]
我是直接在主页后台代码中遍历设置 treenode.target="content" 但貌似行不通
[/Quote]

就是这样做,你目前是什么情况啊?
随性锁欲 2011-10-19
  • 打赏
  • 举报
回复
我是直接在主页后台代码中遍历设置 treenode.target="content" 但貌似行不通
随性锁欲 2011-10-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 andylei0145 的回复:]

指定每个 treeview节点的 target属性对应到 iframe的name
target="content"
[/Quote]
在哪设置呢, 我treeview中的Node在前台html页中根本就没用到,它的值都是从站点地图来的,中间通过一个sitemapdatasource控件绑定的。
PSForever 2011-10-18
  • 打赏
  • 举报
回复
最好是给整个页面一个框架

<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>
andylei0145 2011-10-18
  • 打赏
  • 举报
回复
指定每个 treeview节点的 target属性对应到 iframe的name
target="content"

62,254

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧