頁面指令種類與作用( )
例 使用@ Assembly指令鏈接到用戶定義的程序集MyAssembly 代碼如下
<%@ Assembly Name= MyAssembly %>
例 使用@ Assembly指令鏈接到Visual Basic 源文件MySource vb 代碼如下
<%@ Assembly Name= MySource vb %>
@Control指令
@Control指令與@Page指令基本相似 在 aspx文件中包含了@Page指令 而在 ascx文件中則不包含@Page指令 該文件中包含@Control指令 該指令只能用於用戶控件中 用戶控件在帶有 ascx擴展名的文件中進行定義 每個 ascx文件只能包含壹條@Control指令 此外 對於每個 @Control指令 只允許定義壹個Language屬性 因為每個控件只能使用壹種語言
語法
<%@ Control attribute= value [attribute= value …]%>
其中 attribute表示@Control指令中各屬性 @Control指令屬性的說明如表 所示
表 @Control指令屬性說明
例 新添加壹個 ascx頁 在頁面中@Control指令默認代碼如下
<%@ Control Language= C# AutoEventWireup= true CodeFile= AdminPanel ascx cs
Inherits= Controls_AdminPanel %>
@Master指令
@Master指令只能在母版頁的 master文件中使用 用於標識ASP NET母版頁 每個 master文件只能包含壹條@Master指令
語法
<%@ Master attribute= value [attribute= value …]%>
其中 attribute表示@Master指令中的各屬性 @Master指令屬性的說明如表 所示
表 @Master指令屬性說明
返回目錄 ASP NET開發寶典
編輯推薦
ASP NET開發培訓視頻教程
Microsoft NET框架程序設計視頻教程
ASP NET MVC 框架揭秘
lishixinzhi/Article/program/net/201311/16023