您的位置:首页 > 编程语言 > ASP

Asp.net 模板页、内容页和自定义用户控件

2016-07-06 14:12 309 查看
1.母版页  是以.master结尾文件      声明母版页 :               <%@ MasterLanguage="C#"  AutoEventWireup="true"  CodeBehind="MasterPage.master.cs"  Inherits="Micorsoft_Qis.MasterPage"%>      声明内容页占位标签:<asp:ContentPlaceHolder[b]ID="head"[/b]runat="server">   id="CPH1" 属性标识占位符  相同母版页中允许多个占位符。                                             <asp:ContentPlaceHolder[b]ID="head2"[/b]runat="server">2.内容页就是普通的aspx页面     定义标准内容页:   <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"                                                            CodeBehind="IncomingData.aspx.cs" Inherits="Micorsoft.MasterData.IncomingData" %>                         引用母版页:    <asp:ContentID="Content1" ContentPlaceHolderID="head" runat="Server">                                        <asp:ContentID="Content1" ContentPlaceHolderID="head2"runat="Server">3.用户控件.ascx文件(自定义标签)      定义用户控件:    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Text.ascx.cs" Inherits="A.a" %>
    一般情况下 母版页是做工程主页(带标题和尾部)用的   自定义控件一般是做多个页面都会用到的公共页面使用的,      后面会写一个详细的关于引用自定义控件和自定义控件页面之间传值的文章,敬请期待吧~~~
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息