Re: Class of UserControl not found in Page

Re: Class of UserControl not found in Page

am 30.03.2008 18:08:48 von Mathias Fritsch

>
> Where is the file conained the class 'Contols_Footer' located?
>
Alex,
All files are contained in one web. MasterPage and aspx-Page are in
the main folder.

Controls_Footer is located in subfolder called: Controls.

All files use the same namespace: B2BShop.Web.
The aspx and ascx files have a reference which uses the namespace in
the Inherit - Attribute.
(Inherits="B2BShop.Web.Controls_ProductDetail")

Re: Class of UserControl not found in Page

am 30.03.2008 19:30:56 von nomailreplies

re:
!> Controls_Footer is located in subfolder called: Controls.

re:
!> The aspx and ascx files have a reference which uses the namespace in
!> the Inherit - Attribute. (Inherits="B2BShop.Web.Controls_ProductDetail")

Another way to do this is by placing the .ascx file in the App_Code directory.

See:
http://odetocode.com/Blogs/scott/archive/2005/10/01/2293.asp x

....you don't even need a reference, although the ascx source must use inline code.
That isn't practical for you if you use codebehind in the ascx ( some.ascx.cs, for example ).

However, Bruce is right.

If you want to do it the way you're currently doing it, you must include a reference :

<%@ Reference Control="YourUserControl.ascx" %>

The Inherits statement doesn't provide a reference.




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/
======================================
"Mathias Fritsch" wrote in message
news:95e6401d-8f40-4ec7-8a8f-17b71381985b@p25g2000hsf.google groups.com...
>
>>
>> Where is the file conained the class 'Contols_Footer' located?
>>
> Alex,
> All files are contained in one web. MasterPage and aspx-Page are in
> the main folder.
>
> Controls_Footer is located in subfolder called: Controls.
>
> All files use the same namespace: B2BShop.Web.
> The aspx and ascx files have a reference which uses the namespace in
> the Inherit - Attribute.
> (Inherits="B2BShop.Web.Controls_ProductDetail")
>
>
>