在asp.net 1.1中,要使用用户自定义控件,可能要这样:
<%@ Register TagPrefix="jackyrong" TagName="header" Src="Controls/Header.ascx" %>
<html>
<body>
<form id="form1" runat="server">
<jacky:header ID="MyHeader" runat="server" />
</form>
</body>
</html>
这样如果要在很多页面上设置自定义控件的话,都要在每个页面上加上引用,不大方便,而在asp.net 2.0中,可以先统一在web.config里先
设置好,比如
<?xml version="1.0"?>
<configuration>
<system.web>
<pages>
<controls>
<add tagPrefix="jackyrong" src="~/Controls/Header.ascx" tagName="header"/>
</controls>
</pages>
</system.web>
</configuration>
这样就一样可以在页面里引用自定义控件了,而且不需要每个页面最开始都要那么麻烦的引用了
分享到:
相关推荐
原装的英文版Asp.net2.0 入门经典C#篇.避免了翻译后的质量下降
ASP.NET 2.0入门经典:C#编程篇.part05
Asp.Net2.0读取-修改-新增(配置文件web.config)可以是 ***.config里面有3个文件操作类,System.config,使用文档
ASP.NET 2.0 Website Programming: Problem - Design - Solution 第二部分 Table of Contents ASP.NET 2.0 Website Programming—Problem - Design - Solution Foreword Introduction ...
asp.net2.0.zip asp.net2.0.zip asp.net2.0.zip
ASP.NET 2.0开发详解——使用C#.part15.rar 共16卷
ASP.NET 2.0入门经典:C#编程篇(pdf英文原版)
ASP.NET 2.0入门经典:C#编程篇.part04
ASP.NET 2.0入门经典:C#编程篇.part08
ASP.NET 2.0入门经典:C#编程篇.part03
ASP.NET 2.0入门经典:C#编程篇.part01
ASP.NET 2.0入门经典:C#编程篇.part07
ASP.NET 2.0入门经典:C#编程篇.part02
ASP.NET 2.0入门经典:C#编程篇.part06
Wrox书籍: Wrox ASP.NET 2.0入门经典:C#编程篇.pdf Beginning ASP.NET 2.0 with C# Chris Hart, John Kauffman, David Sussman, and Chris Ullman
《ASP.NET 2.0 入门经典》将逐步引导您使用 ASP.NET 2.0 创建动态的、数据驱动的、复杂的Web站点。在本章结束时,我们将解释一些基本的想法并介绍一个完整的示例站点。然后将学习怎样使用 Visual Web Developer ...
[ASP.NET.2.0.揭秘].Sams.ASP.NET.2.0.Unleashed.Jun.2006.chm ASP.NET 2.0 Unleashed is a revision of the best-selling ASP.NET Unleashed, by Microsoft Software Legend Stephen Walther. It covers ...
asp.net2.0的web.config的配置教学,全部是自己一个人作品的做的,绝对不是拿人家的上传的
ASP.NET 2.0入门经典:C#编程篇
ASP.NET2.0配置文件Web.config 详细解释.rar