.net MVC的框架里,可以用frameset吗?
怎么布局,谢谢!
2 回答
慕沐林林
top.aspx、left.aspx、right.aspx代码基本一样:
控制器HomeController中的代码:
效果图:
TA贡献2016条经验 获得超9个赞
可以的,给你一个上左右结构示例:
framesettest.aspx(注意src的写法,没有.aspx后缀名):
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html>
<html>
<frameset rows="50%,50%">
<frame src="top">
<frameset cols="25%,75%">
<frame src="left">
<frame src="right">
</frameset>
</frameset>
</html>
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>top</title>
</head>
<body>
<div>
data:<%=ViewData["abc"] %>
</div>
</body>
</html>
public ActionResult framesettest()
{
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();
}
- 2 回答
- 0 关注
- 482 浏览
添加回答
举报
0/150
提交
取消