惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Security Latest
Security Latest
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
S
Secure Thoughts
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
GbyAI
GbyAI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
罗磊的独立博客
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
V
V2EX
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tenable Blog
T
Threat Research - Cisco Blogs
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
Lohrmann on Cybersecurity
F
Full Disclosure
H
Help Net Security
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
A
Arctic Wolf
O
OpenAI News
S
Securelist

博客园 - Mack.Z

压缩ASP.NET中的ViewState的改进方法 - Mack.Z - 博客园 压缩ASP.NET中的ViewState MSPlus.TabControl V1.1 版本发布 发布MSPlus TabControl WebControl V1.0.0710 版本 Html Convert Image (Html2Image) MSN Winks 文件的解密 学习SPRING中的一个疑惑.请教一下各位 发布MSPlus DatePicker WebControl V2.0.1201 版本 发布MSPlus ToolBar&Menu WebControl V1.1.0910 版本 MSPlus DatePicker WebControl FreeVersion 1.1.0906 发布啦! 关于MSPlus控件下载后用VS.NET打开提示目录不对的解决方法 - Mack.Z - 博客园 MSPlus ToolBar&Menu WebControl FreeVersion 1.1.0830 发布拉 - Mack.Z [原创]复合控件中如何将客户端的处理结果通知服务器端的解决办法 [原创]屏蔽.NET自定义开发组件中的属性 MSPlus DataList Control(大数据量时的分页演示) MSPlus DataList Control 1.1.0818(个人版) 发布! MSPLUS-DropDownList Control [DEMO Download] 想开发.Net Server Controls 的初学者必读资料 MSPlus-ToolBar Control - Mack.Z - 博客园
Gaia(MasterPage)我的第一个开源控件
Mack.Z · 2005-06-18 · via 博客园 - Mack.Z

Gaia是一个主版頁面规划工具
  GAIA(
Master Page)可以讓您規劃出網站主體風格,使其他的內容頁面或是不同主題都擁有一致的外觀樣式。將來修改網站風格的時候,只需將Master Page換掉,就可以擁有一個全新風格的網站。

GAIA V1.0 Beta(MASTERPAGE)下载地址: http://www.cnblogs.com/mack/articles/176872.html 

类文件说明:

Gaia ------------------------------------------------------------------- 母版控件,用于解析母版

GaiaContent -------------------------------------------------------- Gaia的子控件,用于填充母版中的占位符

GaiaContentCollcetion ------------------------------------------- GaiaContent的容器类,用于管理多个GaiaContent

GaiaAscxPlaceHolder --------------------------------------------- 只限在母版中使用的占位符控件

GaiaAscxForm ------------------------------------------------------ HtmlForm控件的代替品,用于解绝某些.NET FrameWork版本中多个ASCX子控件ID重复的问题

Panel ----------------------------------------------------------------- 占位符控件,也可以当一个Panel来使用 PanelDesigner Panel的设计时形态

类主要属性说明:

Gaia.AscxFile ------------------------------------------------------- 使用的模版页文件名,类型必须为用户控件

Gaia.IgnoreMatching -------------------------------------------- 是否需要忽略匹配(母版中的占位符(GaiaAscxPlaceHolder)是否都需要有对应的GaiaContent)

GaiaControl 模版控件实例 -------------------------------------- GaiaContent.AscxFile 匹配模版页占位符(GaiaAscxPlaceHolder)的用户控件文件名

GaiaContent.ClearPlaceHolderControlContent ----------- 是否需要清空母版页占位符(GaiaAscxPlaceHolder)控件中的默认内容

GaiaContent.PlaceHolderCode -------------------------------- 指定匹配母模版中占位符(GaiaContent.PlaceHolderCode = GaiaAscxPlaceHolder.ID)

GaiaContent.Visable --------------------------------------------- 是否需要显示内容

使用介绍(定义一个母版):
 

<%@ Register TagPrefix="msp" Namespace="MSPlus" Assembly="MSPlus.Gaia" %>
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="ATAGaiaPage.ascx.cs" Inherits="GaiaWebDemo.ATAGaiaPage" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    
<HEAD>
        
<link href="TESTIMAGE/ata.css" rel="stylesheet" type="text/css">
    
</HEAD>
    
<body>
        
<msp:gaiaascxform method="post" runat="server" ID="Form">
            
<TABLE cellSpacing="0" cellPadding="0" width="750" align="center" border="0">
                
<TR>
                    
<TD colSpan="2">
                        
<msp:GaiaAscxPlaceHolder id="ATAPlaceHolder" Runat="server"></msp:GaiaAscxPlaceHolder></TD>
                
</TR>
                
<TR bgColor="#ff9933">
                    
<TD colSpan="2">
                        
<msp:GaiaAscxPlaceHolder id="Gaiaregion2" Runat="server"></msp:GaiaAscxPlaceHolder></TD>
                
</TR>
                
<TR>
                    
<TD width="25%">
                        
<msp:GaiaAscxPlaceHolder id="ATAPlaceLeftLogoB" Runat="server"></msp:GaiaAscxPlaceHolder>
                        
<msp:GaiaAscxPlaceHolder id="ATAPlaceLeftLogoC" Runat="server" Visible="True">HI,MACK.Z</msp:GaiaAscxPlaceHolder>
                        
<msp:GaiaAscxPlaceHolder id="ATAPlaceLeftLogo" Runat="server"></msp:GaiaAscxPlaceHolder></TD>
                    
<TD width="75%">
                        
<msp:GaiaAscxPlaceHolder id="ATAPlaceContent" Runat="server"></msp:GaiaAscxPlaceHolder>
                        
<msp:GaiaAscxPlaceHolder id="ATAPlaceContentTwo" Runat="server"></msp:GaiaAscxPlaceHolder></TD>
                
</TR>
                
<TR>
                    
<TD colSpan="2">
                        
<msp:GaiaAscxPlaceHolder id="ATAPlaceFooter" Runat="server"></msp:GaiaAscxPlaceHolder></TD>
                
</TR>
            
</TABLE>
        
</msp:gaiaascxform>
    
</body>
</HTML>

使用页面一:
 

<%@ Register TagPrefix="msp" Namespace="MSPlus" Assembly="MSPlus.Gaia" %>
<%@ Page language="c#" Codebehind="ATA.aspx.cs" AutoEventWireup="false" Inherits="GaiaWebDemo.ATA" %>
<msp:Gaia runat="server" AscxFile="ASCX/ATAGaiaPage.ascx" ID="ATAGaiaPage">
    
<msp:GaiaContent id="ContentA" AscxFile="ASCX/ATATop.ASCX" runat="server" PlaceHolderCode="ATAPlaceHolder"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentB" AscxFile="ASCX/ATALeftLogo.ASCX" runat="server" PlaceHolderCode="ATAPlaceLeftLogo"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentG" AscxFile="ASCX/ATALeftLogoB.ASCX" runat="server" PlaceHolderCode="ATAPlaceLeftLogoB"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentD" AscxFile="ASCX/ATAFOOTER.ASCX" runat="server" PlaceHolderCode="ATAPlaceFooter"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentF" runat="server" PlaceHolderCode="ATAPlaceLeftLogoC" ClearPlaceHolderControlContent="false">
        
<align="center"><IMG src="TESTIMAGE/Shire.JPG"></P>
    
</msp:GaiaContent>
    
<msp:GaiaContent id="ContentC" runat="server" PlaceHolderCode="ATAPlaceContent">
        
<TABLE height="200" cellSpacing="1" cellPadding="3" width="100%" border="0">
            
<TR>
                
<TD>ATA--全美测评软件系统(北京)有限公司 ATAPlaceContent
                    
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
                    
<P></P>
                    
<P><FONT color="#4c4c4c">ATA是一家业内领先的专业从事考试服务的公司,为客户提供最佳的整体考试解决方案并协助客户推广实施其考试认证项目。ATA在中国拥有1000余家特许加盟考站及认证考试中心,每年承接着来自政府机构、教育机构、企事业单位的考试470多种,年考试量在200万人次以上。 
                            ATA还向美国微软公司等国际考试机构提供着考试技术。
</FONT>
                    
</P>
                
</TD>
            
</TR>
        
</TABLE>
    
</msp:GaiaContent>
    
<msp:GaiaContent id="ContentE" runat="server" PlaceHolderCode="ATAPlaceContentTwo">
        
<TABLE height="300" cellSpacing="1" cellPadding="3" width="100%" border="0">
            
<TR>
                
<TD>事件测试(ATAPlaceContentTwo事件发生者 -&gt; ATAPlaceContent事件接收者):
                    
<asp:Button id="Button1" runat="server" Text="Hello Mack"></asp:Button></TD>
            
</TR>
            
<TR>
                
<TD><FONT color="#333333"><B>ATA历史<name="3"></A> ATAPlaceContentTwo</B></FONT>
                    
<P></P>
                    
<P><FONT color="#4c4c4c">ATA公司于1999年在美国纽约成立,同年在中国北京设立独资公司。至今,先后在上海、江苏、山东、福建、吉林、重庆、广东、陕西、湖南、江西、浙江、安徽等省、直辖市的中心城市设立了13家分支机构。</FONT></P>
                    
<P><FONT color="#4c4c4c">2003年初,ATA以国际领先的ATA e-Testing核心考试技术及在考试行业已取得的良好业绩而被纳入<FONT color="#4d4d4d">ATP(<class="a03" href="http://www.testpublishers.org/">Association 
                                    of Test Publishers
</A>)组织</FONT>, ATA此次参会成为该组织有史以来第一位参加年会的中国会员。</FONT></P>
                    
<P><FONT color="#4c4c4c">2003年7月,ATA根据越来越多的业务划分,将公司拆分为<FONT color="#505050">ATA考试公司(<class="a03" href="http://www.ata.net.cn/">ATA 
                                    Testing Authority Inc.
</A></FONT><FONT color="#525252">ATA教育服务公司(<class="a03" href="http://www.atalearning.com/">ATA 
                                    Learning (Bejing)Inc.
</A></FONT>。ATA考试公司主要从事与考试服务相关的业务,如承接政府的各大考试项目、为厂商提供认证考试服务、为企业订制考试系统及协助企业HR部门进行人才招聘工作;ATA教育服务公司则以教育项目为主,成为从事中国教育服务和教育产业投资发展的专业公司。</FONT>
                    
</P>
                
</TD>
            
</TR>
        
</TABLE>
    
</msp:GaiaContent>
</msp:Gaia>


使用页面二   

<%@ Register TagPrefix="msp" Namespace="MSPlus" Assembly="MSPlus.Gaia" %>
<%@ Page language="c#" Codebehind="ATA2.aspx.cs" AutoEventWireup="false" Inherits="GaiaWebDemo.ATA2" %>
<msp:Gaia runat="server" AscxFile="ASCX/ATAGaiaPage.ascx" ID="ATAGaiaPage" ClearRegionChildControl="true">
    
<msp:GaiaContent id="ContentA" AscxFile="ASCX/ATATop.ASCX" runat="server" PlaceHolderCode="ATAPlaceHolder"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentB" AscxFile="ASCX/ATALeftLogo.ASCX" runat="server" PlaceHolderCode="ATAPlaceLeftLogo"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentG" AscxFile="ASCX/ATALeftLogoB.ASCX" runat="server" PlaceHolderCode="ATAPlaceLeftLogoB"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentD" AscxFile="ASCX/ATAFOOTER.ASCX" runat="server" PlaceHolderCode="ATAPlaceFooter"></msp:GaiaContent>
    
<msp:GaiaContent id="ContentF" runat="server" PlaceHolderCode="ATAPlaceLeftLogoC">
        
<align="center"><IMG src="TESTIMAGE/firework.gif"></P>
    
</msp:GaiaContent>
    
<msp:GaiaContent id="ContentC" runat="server" PlaceHolderCode="ATAPlaceContent">
        
<TABLE height="200" cellSpacing="1" cellPadding="3" width="100%" border="0">
            
<TR>
                
<TD><B>ATA--全美测评软件系统(北京)有限公司</B>
                    
<BR>
                    
<BR>
                    
<FONT color="#4c4c4c">模拟练习产品是配合各项认证考试的辅助练习产品。ATA为大多数考试都开发了模拟练习盘,考生通过在模拟练习盘上练习,一则可以熟悉考试界面形式,了解各功能按钮的功能,同时,作为正式参加考试前的模拟热身练习,了解自身对认证重点、难点的掌握程度。<BR>
                    
</FONT>
                
</TD>
            
</TR>
        
</TABLE>
    
</msp:GaiaContent>
    
<msp:GaiaContent id="ContentE" runat="server" PlaceHolderCode="ATAPlaceContentTwo">
        
<TABLE height="300" cellSpacing="1" cellPadding="3" width="100%" border="0">
            
<TR>
                
<TD><IMG src="TESTIMAGE/20048141123320.jpg">
                
</TD>
            
</TR>
        
</TABLE>
    
</msp:GaiaContent>
</msp:Gaia>



GAIA(MASTERPAGE)下载地址: http://www.cnblogs.com/mack/articles/176872.html 

其它一些MASTERPAGE开源程序的下载和介绍,大家用之前可以比较一下:

1.An Extensible Master-Page Framework for ASP.NET 1.1 Using Pattern Oriented Design
http://www.codeproject.com/aspnet/Frame_Work_Design.asp

2.Wilson Master Page
http://authors.aspalliance.com/PaulWilson/Articles/?id=14