473,797 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Whatev er"/>

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 3822
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
988
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 The control is in diff directory from the window exe The user control references another user control usercontrol2.dll which uses clipboard to set a serializable class objec and get the object from the clipboard The two user control dll files...
2
1423
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 dropdownbox selectedindexchanged work. Any ideas?
3
3042
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
1656
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 to run projectL Unable to start debugging on the web
2
1606
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 users controls I have 4 seperate validation summaries, what I would like is to have only a single validation summary at the top of the page, ie not in any user controls.
0
1277
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 class AAA has a shared method ReturnString() which the asp.net pages can use fine, but the master page and web user controls cannot. VS2005's source view shows that the master page and web user controls have
5
1751
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 installed .NET 2.0. Now the control loads into .NET 2.0 instead of 1.1 (per System.Environment.Runtime) on my development box. I'm using an app.config file that I'm pulling into the aspx page using a <link> element. In that config file I'm...
1
2247
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 Customer Orders scenario: Problem: User needs to view orders and and edit, add, save on one page called Orders.aspx. To begin with the page contains a grid with basic information about an order. The user can click a row to edit or click an "Add"...
0
1156
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 shouldn't either or that there is some better way. I have used them in tutorials with web parts, but the articles were several years old. What I have in reality is a gridview. Would it be bad practice to put that gridview in a user control and drop...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10468
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10245
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10205
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9063
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.