473,605 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Web.config's <system.web><pa ges><controls>< add /></controls></pages></system.web> To Register UserControls

My Web.config file contains the following section to register some of my
UserControls:

<pages>
<controls>
<add tagPrefix="NATE " tagName="Banner " src="~/Banner.ascx"/>
<add tagPrefix="NATE " tagName="Naviga tion" src="~/Navigation.ascx "/>
</controls>
</pages>

However, I still receive the following error:

Element 'Banner' is not a known element. This can occur if there is a
compilation error in the Web site.
Element 'Navigation' is not a known element. This can occur if there is a
compilation error in the Web site.

I have tried compiling, and this is the only error I receive. Is there
something I am forgetting to do? Is there something wrong with my Web.config
file? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Dec 20 '06 #1
5 2425
Put the ASCX files into a subdirectory and then try it.

-Brock
http://staff.develop.com/ballen

My Web.config file contains the following section to register some of
my UserControls:

<pages>
<controls>
<add tagPrefix="NATE " tagName="Banner " src="~/Banner.ascx"/>
<add tagPrefix="NATE " tagName="Naviga tion"
src="~/Navigation.ascx "/>
</controls>
</pages>
However, I still receive the following error:

Element 'Banner' is not a known element. This can occur if there is a
compilation error in the Web site.
Element 'Navigation' is not a known element. This can occur if there
is a
compilation error in the Web site.
I have tried compiling, and this is the only error I receive. Is there
something I am forgetting to do? Is there something wrong with my
Web.config file? Thanks.

Dec 20 '06 #2
Didn't help. I think that Visual Studio .NET 2005 is not realizing that I
have the controls registered in my Web.config file. Any other ideas?
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Brock Allen" <ba****@NOSPAMd evelop.comwrote in message
news:b8******** *************** **@msnews.micro soft.com...
Put the ASCX files into a subdirectory and then try it.

-Brock
http://staff.develop.com/ballen

>My Web.config file contains the following section to register some of
my UserControls:

<pages>
<controls>
<add tagPrefix="NATE " tagName="Banner " src="~/Banner.ascx"/>
<add tagPrefix="NATE " tagName="Naviga tion"
src="~/Navigation.ascx "/>
</controls>
</pages>
However, I still receive the following error:

Element 'Banner' is not a known element. This can occur if there is a
compilation error in the Web site.
Element 'Navigation' is not a known element. This can occur if there
is a
compilation error in the Web site.
I have tried compiling, and this is the only error I receive. Is there
something I am forgetting to do? Is there something wrong with my
Web.config file? Thanks.


Dec 20 '06 #3
Nathan,

I don't see "src" documented anywhere.
I do see "source" documented, however.

Could you check to see if this works :

<add
tagprefix="NATE "
tagname="Banner "
source="Banner. ascx"/>

<add
tagprefix="NATE "
tagname="Naviga tion"
source="Navigat ion.ascx"/>

?

....and let us know if it works.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
My Web.config file contains the following section to register some of my UserControls:

<pages>
<controls>
<add tagPrefix="NATE " tagName="Banner " src="~/Banner.ascx"/>
<add tagPrefix="NATE " tagName="Naviga tion" src="~/Navigation.ascx "/>
</controls>
</pages>

However, I still receive the following error:

Element 'Banner' is not a known element. This can occur if there is a compilation error in the Web
site.
Element 'Navigation' is not a known element. This can occur if there is a compilation error in the
Web site.

I have tried compiling, and this is the only error I receive. Is there something I am forgetting
to do? Is there something wrong with my Web.config file? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Dec 20 '06 #4
I am not sure what documentation you are looking at, but if you go to:

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20 .en/dv_ASPNETgenref/html/852861eb-dba7-41eb-9c34-fa09b99abac0.ht m

It contains the following documentation under the Attributes section:
src
Optional String attribute.

Specifies the name of the file that contains the user control and
requires that the tagName attribute is also set.


Also, when I tried changing it from src to source the error specified that
'source' was an unrecognized attribute. Any other ideas?
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.comwrot e in message
news:ew******** ******@TK2MSFTN GP04.phx.gbl...
Nathan,

I don't see "src" documented anywhere.
I do see "source" documented, however.

Could you check to see if this works :

<add
tagprefix="NATE "
tagname="Banner "
source="Banner. ascx"/>

<add
tagprefix="NATE "
tagname="Naviga tion"
source="Navigat ion.ascx"/>

?

...and let us know if it works.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>My Web.config file contains the following section to register some of my
UserControls :

<pages>
<controls>
<add tagPrefix="NATE " tagName="Banner " src="~/Banner.ascx"/>
<add tagPrefix="NATE " tagName="Naviga tion" src="~/Navigation.ascx "/>
</controls>
</pages>

However, I still receive the following error:

Element 'Banner' is not a known element. This can occur if there is a
compilation error in the Web site.
Element 'Navigation' is not a known element. This can occur if there is a
compilation error in the Web site.

I have tried compiling, and this is the only error I receive. Is there
something I am forgetting to do? Is there something wrong with my
Web.config file? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/


Dec 21 '06 #5
If the ascx and aspx are in the same directory, you will get an error
stating that the control could not be loaded:

"because it is registered in web.config and lives in the same directory as
the page"

Make a directory, say, UControls and then do the following:

<add tagPrefix='nate ' tagName='Banner ' src='~/UControls/Banner.ascx' />

btw, there's no 'source' attribute. There's only 'src' attribute in
<controls><adde lement.
HTH

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujinionline.com
-----------------------------------------
"Juan T. Llibre" <no***********@ nowhere.comwrot e in message
news:ew******** ******@TK2MSFTN GP04.phx.gbl...
Nathan,

I don't see "src" documented anywhere.
I do see "source" documented, however.

Could you check to see if this works :

<add
tagprefix="NATE "
tagname="Banner "
source="Banner. ascx"/>

<add
tagprefix="NATE "
tagname="Naviga tion"
source="Navigat ion.ascx"/>

?

...and let us know if it works.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>My Web.config file contains the following section to register some of my
UserControls :

<pages>
<controls>
<add tagPrefix="NATE " tagName="Banner " src="~/Banner.ascx"/>
<add tagPrefix="NATE " tagName="Naviga tion" src="~/Navigation.ascx "/>
</controls>
</pages>

However, I still receive the following error:

Element 'Banner' is not a known element. This can occur if there is a
compilation error in the Web site.
Element 'Navigation' is not a known element. This can occur if there is a
compilation error in the Web site.

I have tried compiling, and this is the only error I receive. Is there
something I am forgetting to do? Is there something wrong with my
Web.config file? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/


Jan 10 '07 #6

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

Similar topics

14
10771
by: Ian Rastall | last post by:
I'm curious as to the group's feelings about using the <fieldset> and <legend> tags around elements other than <form> elements ... I wrote a small test file: <http://www.learnsomethingnew.us/fieldset.html> to illustrate this, and it validated at both the W3C and WDG sites. (It's a <fieldset> around a <table> and <p>). I'm able to view it on Opera 7.23, Mozilla 1.6, and IE 6. (Moz 1.6 renders it in Standards Compliance Mode as well.)
7
1585
by: Brad | last post by:
I'm placing a runat=server attribute on the <title> tag in my pages, so I can read/set the title text in code. The problem is that when I subsequently change the page in design view VS is removing the runat=server from the <title> tag. Unfortunately it does not do it all the time...maybe 50%. Brad
8
1635
by: Mark | last post by:
We have a multi-line textbox that users copy and paste email text into. The pasted text frequently will contain a tag like <blah@aol.com> or similar. I believe .NET is protecting itself from code injection by throwing a global error when this occurs. The exception message is pasted below. We will NOT be able to train our users to eliminate all <> tags. What's the best way to deal with this issue? Thanks in advance.
2
3614
by: Don Wash | last post by:
Hi There! I'm creating my website with ASP.NET + XHTML, which means I will strictly adhere the XHTML standards for my web page output. I use Panel or PlaceHolder WebControls to place dynamically created <div></div> contents to my web pages. But the problem arises when because Panel and PlaceHolder WebControls do extra work with <span> tags as follows...
2
7356
by: Axel Dahmen | last post by:
HI, I want to dynamically add controls to a web page from within a common base class. Unfortunately, ASP.NET fails with "System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." All of my pages contain these kind of blocks, for several reasons. For one, I don't know any other way to dynamically add header information like e.g. style sheet links to a web page. So, is...
29
3666
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form id="Form1" method="post" runat="server"> <%
4
1744
by: serge calderara | last post by:
Dear all, I have read that instead of registering an assembly on the top a a page with the Register directive we can use the <assembliea> section of Web config file as follow : <assemblies> <add assembly="SharpUI.Input, Version=1.1.1.1220, Culture=neutral, PublicKeyToken=f517ee9424cd48d0"/>
4
13320
by: Alex Maghen | last post by:
I have a master page which contains a general page framework and also contains a <form runat=server> around most of the content of the page. Inside that <form> tag is a ContentPlaceholder. I then create an ASPX which is tied to that MasterPage and in it a put a bunch of form fields and an <asp:Button />. When I try to run the page, I get... "Control 'ctl00_BodyCPH_ctl00' of type 'Button' must be placed inside a form tag with...
5
1651
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE" tagName="Navigation" src="~/Navigation.ascx"/> </controls> </pages>
0
8424
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
8415
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
8069
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
8286
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
6742
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...
0
5445
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2438
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
0
1270
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.