1. 程式人生 > >框架頁面盡可以這麽用(後置代碼中控制框架)

框架頁面盡可以這麽用(後置代碼中控制框架)

out get .cn top align lock 顯示 摘要 oct

下面是框架頁:

技術分享<%@ 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技術分享

框架頁面盡可以這麽用(後置代碼中控制框架)