473,396 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

registering user controls in web.config, causes error if used in same directory...

Hi,
i have this in my web.config:
<pages validateRequest="false" >
<controls>
<add tagPrefix="uc1" src="/Whatever.ascx" tagName="Whatever"/>

i have this in Login.aspx:
<uc1:Whatever id="Blah" runat="server">

I get this error message:

Cannot use the user control '/Whatever.ascx', because it is registered in
web.config and lives in the same directory as the page.

this same message has been posted twice without answers on the forums at
www.asp.net
http://forums.asp.net/thread/1347796.aspx
http://forums.asp.net/thread/1253193.aspx

does anyone know what is going wrong?

i'm using a Web Application Project. the problem goes away when i move the
user control into a subdirectory and update the web.config reference etc.

thanks in advance
tim
Aug 29 '06 #1
3 3805
Hi Tim,

This limitation is documented in following MSDN library:

http://msdn2.microsoft.com/en-us/lib...ion.tagprefixi
nfo.aspx

This is due to internal design consideration (performance). The common use
of this new feature is to have a directory containing a bunch of user
controls, and register them in config so that they are available in all
pages. Thank you for your understanding.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 30 '06 #2
great, that's not a problem to adopt this pattern in my apps.

thank you again
tim
Aug 30 '06 #3
The [controls] tag also doesn't work when used in a web.config file
that's in a subdirectory of the root directory, right?

Walter Wang [MSFT] wrote:
Hi Tim,

This limitation is documented in following MSDN library:

http://msdn2.microsoft.com/en-us/lib...ion.tagprefixi
nfo.aspx

This is due to internal design consideration (performance). The common use
of this new feature is to have a directory containing a bunch of user
controls, and register them in config so that they are available in all
pages. Thank you for your understanding.
Sep 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: keith | last post by:
I have an Window app that load a user control usercontrol1.dll b Assembly assembly=Assembly.LoadFrom("path\usercontrol1.dll") Control ui=assembly.CreateInstance("NameSpace.ClassName) as Control ...
2
by: Brent Burkart | last post by:
Has anyone experienced any problems with their selectedindexchanged not firing when there are user controls present on the page? I have 4 controls on a page and only once I remove all 4 does my...
3
by: Richard Payne | last post by:
Hi I am after what is the best/simplest way to pass objects between Web User Controls which doesn't use the session object. Regards Richard
5
by: Eric Sabine | last post by:
the second I add <appSettings> </appSettings> to my web.config file (just after the <system.web>), my web application will no longer run. I get an error that reads: Error while tyring...
2
by: Martin | last post by:
Hi, I have a page with 4 web user controls on. Each of these web user controls has some asp.net controls on that have validation events attached to them. Now because there are 4 seperate...
0
by: bminder | last post by:
Hello, Why would a web user control and master page not have access to a shared method in a library, when all regular pages do? For example, i have a library which has public class AAA. Public...
5
by: Keith | last post by:
Please help. I've been developing a windows forms user control to be hosted in IE/ASP.NET. The control is developed in .NET v1.1, and for now I'll need to keep it in that version. Recently I...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
0
by: jm | last post by:
Some of the articles I have read are old, and I just don't know if user controls .ascx are still used widely. I know they can be created, but if very few use them today it makes me think I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.