Is it possble to register a user control in a web.config that is located in a subfolder of the website's root web.config? If I register it in the root web.config with a prefix of "xx" it works fine when I drag it on a page. But, if I register it in a
web.config in a subfolder it does not. It will just register it on the page with the prefix "uc1" I'm guessing this is just how it is setup in asp.net
If you register the user controls in the web.config.. you can use inside any subfolder ... it should work.
The error you are having can be originated because the page is not getting the last info refreshed from the web.config... to solve this issue, you can generate your project again... perhaps you should also close the page at the visual studio y open it again...
sometimes, this issue is solved closing and reopening again the visual studio.
Is it possble to register a user control in a web.config that is located in a subfolder of the website's root web.config? If I register it in the root web.config with a prefix of "xx" it works fine when I drag it on a page. But, if I register it in a
web.config in a subfolder it does not. It will just register it on the page with the prefix "uc1" I'm guessing this is just how it is setup in asp.net
Based on my expeience, if you want to regist the control in web.config avoid registing it in every page. I think you should notice the following options:
1. To regist the control in web.config, it doesn't accept the relate path. you should add the User control to the sub folder.
2. You should locate the web.config and the user control in different place.
3. The page will execute the latest config file and apply the relate policy to it. this is the reason that it allow one or more config file in one project.
How to regist the user control in web.config, please refer to the following links:
Member
52 Points
139 Posts
Register User Control in subfolder web.config
Mar 09, 2009 01:40 PM|dsa1971|LINK
Is it possble to register a user control in a web.config that is located in a subfolder of the website's root web.config? If I register it in the root web.config with a prefix of "xx" it works fine when I drag it on a page. But, if I register it in a web.config in a subfolder it does not. It will just register it on the page with the prefix "uc1" I'm guessing this is just how it is setup in asp.net
user controls
Star
7763 Points
1545 Posts
Re: Register User Control in subfolder web.config
Mar 09, 2009 03:51 PM|Segundo|LINK
Hi,
If you register the user controls in the web.config.. you can use inside any subfolder ... it should work.
The error you are having can be originated because the page is not getting the last info refreshed from the web.config... to solve this issue, you can generate your project again... perhaps you should also close the page at the visual studio y open it again... sometimes, this issue is solved closing and reopening again the visual studio.
Any doubt, post your comment.
Blog: http://www.neuronasoft.net
All-Star
20997 Points
2575 Posts
Re: Register User Control in subfolder web.config
Mar 12, 2009 03:06 AM|Gary yang - MSFT|LINK
Based on my expeience, if you want to regist the control in web.config avoid registing it in every page. I think you should notice the following options:
1. To regist the control in web.config, it doesn't accept the relate path. you should add the User control to the sub folder.
2. You should locate the web.config and the user control in different place.
3. The page will execute the latest config file and apply the relate policy to it. this is the reason that it allow one or more config file in one project.
How to regist the user control in web.config, please refer to the following links:
1. http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx
2. http://msdn.microsoft.com/en-us/library/4saat087.aspx
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.