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

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - Felix Liang

精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件 精进 Spring Boot 02 | Spring Boot 的文档结构、POM 文件格式的介绍,以及 Maven 的使用。 精进 Spring Boot 01 | Spring Boot 入门,用 Spring Boot 写第一个 Hello World How do I get started with Node.js 修改xampp的mysql默认密码和端口 Visual Studio 2013 错误系统找不到指定文件,0x80070002 Daily Build H公司数据同步的总结 VB2010新特性之——标识语言版本的新命令行选项/langversion (Visual Basic) 为什么开发人员不能估算时间? [翻译]SQL Server 未公开的两个存储过程sp_MSforeachtable 和 sp_MSforeachdb 获取应用程序的根Url - Felix Liang - 博客园 Lambda 表达式 Lambda Expressions (Visual Basic) 集合初始化器概览(Visual Basic) 宽松委托转换(Relaxed delegate conversion) VB2010 的隐式续行(Implicit Line Continuation) 自动实现属性 Visual Basic 2010 新特性 VS2008 Tips #008 如何创建ASP.NET Web 用户控件并包含在Web 页面中 - Felix Liang
VS2008 Tips #009 – 您可以在 ASP.NET 的 Web.config 文件中注册用户控件
Felix Liang · 2009-11-22 · via 博客园 - Felix Liang

Tip#8, 我们探讨了如何在 Page页面中创建、注册、使用 Web 用户控件。注意到拖拽用户控件到页面时,VS 添加了一个 @Register 指令在页面脚本的顶部。

但是将来您想移动您的用户控件的位置,您被迫在多个页面文件中更改注册指令,修改数目在于您使用用户控件的页面数量。这个问题可以通过在 Web.config 文件中注册用户控件得到解决。通过下面注册方式,用户控件位置的变迁只需在一个地方将注册信息随之更新即可。

Web.config 节如下:

<configuration>

<system.web>

<pages>

<controls>

    <add tagPrefix="MyControl" tagName="MyButton" src="~/Controls/WebUserControl.ascx" />

</controls>

</pages>

</system.web>

</configuration>

一旦 web.config 的用户控件节已经创建,它可以在任何页面中使用,而且还有智能感知提示。

<body>

<form id="form1" runat="server">

<MyControl:MyButton ID="MyUserControl" runat="server" />

</form>

</body>

下载

下载代码

参考阅读