码迷,mamicode.com
首页 > 其他好文 > 详细

框架页面尽可以这么用(后置代码中控制框架)

时间:2017-05-25 23:27:51      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:type   ebe   attr   支持   session   cat   4.0   sub   bsp   

下面是框架页:

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

框架页面尽可以这么用(后置代码中控制框架)

标签:type   ebe   attr   支持   session   cat   4.0   sub   bsp   

原文地址:http://www.cnblogs.com/zhangyuhang3/p/6906051.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!