下面是框架页:
<%
@ 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
>
后置代码如下:
<%
@ 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
>
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
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
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
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
49
main.Attributes.Add("src","Person.aspx");
50
}
51
52
Web 窗体设计器生成的代码
72
}
73
}
74
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

9
namespace
IbatisTest.Web10
{11
/// <summary>12
/// Frameset 的摘要说明。13
/// </summary>14
public class Frameset : System.Web.UI.Page15
{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

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

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

49
main.Attributes.Add("src","Person.aspx");50
}51

52
Web 窗体设计器生成的代码72
}73
}
74
本文转自 张善友 51CTO博客,原文链接:http://blog.51cto.com/shanyou/75244,如需转载请自行联系原作者