Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 4th, 2012, 02:17 PM
Registered User
 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default site-wide registration of an user control

Hi. Can anyone explain to me how to do a site-wide registration of an User Control? Thank you.
 
Old April 4th, 2012, 02:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can add something like this to the system.web element in web.config:

Code:
<pages>
  <controls>
    <add tagPrefix="YourPrefix" tagName="ControlName" src="~/Controls/ControlName.ascx"/>
  </controls>
</pages>
You can then use the control like this:

Code:
 
<YourPrefix:ControlName ID="ControlName1" runat="server" />
Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Site-Wide Registration of User Controls Khalil BOOK: Beginning ASP.NET 4 : in C# and VB 25 October 7th, 2011 03:21 AM
MCMS 2002 site wide search problem jey_cms General .NET 0 March 13th, 2007 08:32 AM
MCMS 2002 site wide search problem jey_cms General .NET 0 March 13th, 2007 08:23 AM
Any Idea About Site Wide Search Engine yoord BOOK: Beginning ASP.NET 1.0 8 October 11th, 2004 08:31 AM
Site Wide Enum - Best Practice rodmcleay ASP.NET 1.0 and 1.1 Professional 8 June 8th, 2004 08:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.