框架页面尽可以这么用(后置代码中控制框架)
下面是框架页:
<%@ Page CodeBehind="Frameset.aspx.cs" Language="c#" AutoEventWireup="false" Inherits="IbatisTest.Web.Frameset" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<HTML>
<HEAD>
<TITLE>内容框架集</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<frameset cols="150,*" id="detail" runat="server">
<frame name="contents" id="contents" runat=server src=""></frame>
<frame name="main" id="main" src="" runat="server"></frame>
<noframes>
<p id="p1">
此 HTML 框架集显示多个 Web 页。若要查看此框架集,请使用支持 HTML 4.0 及更高版本的 Web 浏览器。
</p>
</noframes>
</frameset>
</HTML>
<p id="p1">
此 HTML 框架集显示多个 Web 页。若要查看此框架集,请使用支持 HTML 4.0 及更高版本的 Web 浏览器。
</p>
<p id="p1">
此 HTML 框架集显示多个 Web 页。若要查看此框架集,请使用支持 HTML 4.0 及更高版本的 Web 浏览器。
</p>
<p id="p1">
此 HTML 框架集显示多个 Web 页。若要查看此框架集,请使用支持 HTML 4.0 及更高版本的 Web 浏览器。
</p>
后置代码如下:
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
1
using System.Data;
2
using System.Drawing;
3
using System.Web;
4
using System.Web.SessionState;
5
using System.Web.UI;
6
using System.Web.UI.WebControls;
7
using System.Web.UI.HtmlControls;
8![](/Images/OutliningIndicators/None.gif)
9
namespace IbatisTest.Web
10
{
11
/// <summary>
12
/// Frameset 的摘要说明。
13
/// </summary>
14
public class Frameset : System.Web.UI.Page
15
{
16
protected System.Web.UI.HtmlControls.HtmlGenericControl detail;
17
protected System.Web.UI.HtmlControls.HtmlGenericControl contents;
18
protected System.Web.UI.HtmlControls.HtmlGenericControl main;
19
20
private void Page_Load(object sender, System.EventArgs e)
21
{
22
detail.Attributes.Add("src","default.aspx");
23
detail.Attributes.Add("framespacing", "0") ;
24
detail.Attributes.Add("frameborder", "0") ;
25
detail.Attributes.Add("marginwidth", "0") ;
26
detail.Attributes.Add("marginheight", "0") ;
27
detail.Attributes.Add("topmargin", "0") ;
28
detail.Attributes.Add("leftmargin", "0") ;
29![](/Images/OutliningIndicators/InBlock.gif)
30
contents.Attributes.Add("NAME", "hauttop") ;
31
contents.Attributes.Add("MARGINHEIGHT", "0") ;
32
contents.Attributes.Add("MARGINWIDTH", "0") ;
33
contents.Attributes.Add("topmargin", "0") ;
34
contents.Attributes.Add("leftmargin", "0") ;
35
contents.Attributes.Add("SCROLLING", "no") ;
36
contents.Attributes.Add("framespacing", "0") ;
37
contents.Attributes.Add("frameborder", "0") ;
38![](/Images/OutliningIndicators/InBlock.gif)
39
contents.Attributes.Add("src","default.aspx");
40
main.Attributes.Add("NAME", "corpscentre") ;
41
main.Attributes.Add("MARGINHEIGHT", "0") ;
42
main.Attributes.Add("MARGINWIDTH", "0") ;
43
main.Attributes.Add("frameborder", "1") ;
44
main.Attributes.Add("SCROLLING", "auto") ;
45
main.Attributes.Add("framespacing", "0") ;
46
main.Attributes.Add("topmargin", "1") ;
47
main.Attributes.Add("leftmargin", "0") ;
48![](/Images/OutliningIndicators/InBlock.gif)
49
main.Attributes.Add("src","Person.aspx");
50
}
51![](/Images/OutliningIndicators/InBlock.gif)
52
Web 窗体设计器生成的代码
72
}
73
}
74![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
8
![](/Images/OutliningIndicators/None.gif)
9
![](/Images/OutliningIndicators/None.gif)
10
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
11
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
14
![](/Images/OutliningIndicators/InBlock.gif)
15
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
16
![](/Images/OutliningIndicators/InBlock.gif)
17
![](/Images/OutliningIndicators/InBlock.gif)
18
![](/Images/OutliningIndicators/InBlock.gif)
19
![](/Images/OutliningIndicators/InBlock.gif)
20
![](/Images/OutliningIndicators/InBlock.gif)
21
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
22
![](/Images/OutliningIndicators/InBlock.gif)
23
![](/Images/OutliningIndicators/InBlock.gif)
24
![](/Images/OutliningIndicators/InBlock.gif)
25
![](/Images/OutliningIndicators/InBlock.gif)
26
![](/Images/OutliningIndicators/InBlock.gif)
27
![](/Images/OutliningIndicators/InBlock.gif)
28
![](/Images/OutliningIndicators/InBlock.gif)
29
![](/Images/OutliningIndicators/InBlock.gif)
30
![](/Images/OutliningIndicators/InBlock.gif)
31
![](/Images/OutliningIndicators/InBlock.gif)
32
![](/Images/OutliningIndicators/InBlock.gif)
33
![](/Images/OutliningIndicators/InBlock.gif)
34
![](/Images/OutliningIndicators/InBlock.gif)
35
![](/Images/OutliningIndicators/InBlock.gif)
36
![](/Images/OutliningIndicators/InBlock.gif)
37
![](/Images/OutliningIndicators/InBlock.gif)
38
![](/Images/OutliningIndicators/InBlock.gif)
39
![](/Images/OutliningIndicators/InBlock.gif)
40
![](/Images/OutliningIndicators/InBlock.gif)
41
![](/Images/OutliningIndicators/InBlock.gif)
42
![](/Images/OutliningIndicators/InBlock.gif)
43
![](/Images/OutliningIndicators/InBlock.gif)
44
![](/Images/OutliningIndicators/InBlock.gif)
45
![](/Images/OutliningIndicators/InBlock.gif)
46
![](/Images/OutliningIndicators/InBlock.gif)
47
![](/Images/OutliningIndicators/InBlock.gif)
48
![](/Images/OutliningIndicators/InBlock.gif)
49
![](/Images/OutliningIndicators/InBlock.gif)
50
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
51
![](/Images/OutliningIndicators/InBlock.gif)
52
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
72
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
73
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
74
![](/Images/OutliningIndicators/None.gif)
欢迎大家扫描下面二维码成为我的客户,扶你上云
![](https://images.cnblogs.com/cnblogs_com/shanyou/57459/o_220125090408_%E9%82%80%E8%AF%B7%E4%BA%8C%E7%BB%B4%E7%A0%81-258px.jpeg)