MSPlus WebControls For ASP.NET. (服务器端控件)

Upgrade Develop Efficiency,Surprise For U! - 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
posted on 2005-06-18 21:22  Mack.Z  阅读(9213)  评论(16编辑  收藏  举报