frameset问题

dongshanyu 2012-08-24 03:36:43
ASP.NET,MVC3下使用frameset,调用frameset所在画面Index,但显示出来的是一个空白画面,不知道问题在哪.

相关代码如下:

(1) 页面代码:



<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Menu Index</title>
</head>
<body>

<frameset name="main" rows="100,*,50" frameborder="no" border="0" framespacing="0" >
<frame src="Menu/Top" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" />
<frameset cols="25%,75%">
<frame src="Menu/Left" name="LeftFrame" id="LeftFrame" />
<frame src="Menu/Right" name="RightFrame" id="RightFrame" />
</frameset>
<frame src="Menu/Bottom" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" />
</frameset>

</body>
</html>



(2) Controller代码:



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Web.Mvc;

namespace MyMvc3.Controllers.Menu
{
public class MenuController:Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Top()
{
ViewData["abc"] = "top";
return View();
}
public ActionResult Left()
{
ViewData["abc"] = "left";
return View();
}
public ActionResult Right()
{
ViewData["abc"] = "right";
return View();
}
public ActionResult Bottom()
{
ViewData["abc"] = "bottom";
return View();
}
}
}




...全文
133 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dongshanyu 2012-08-24
  • 打赏
  • 举报
回复
To net_lover
你是对的。

To jhl52771
以下3种写法均可:
src="Menu/Left"
src="/Menu/Left"
src="Left"
杰拉尔 2012-08-24
  • 打赏
  • 举报
回复
<frame src="Menu/Left" name="LeftFrame" id="LeftFrame" />
<frame src="Menu/Right" name="RightFrame" id="RightFrame" />

要改成

<frame src="/Menu/Left" name="LeftFrame" id="LeftFrame" />
<frame src="/Menu/Right" name="RightFrame" id="RightFrame" />
孟子E章 2012-08-24
  • 打赏
  • 举报
回复
frameset和<body>不能同时存在。需要删除<body></body>

62,074

社区成员

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

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

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

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