ODS can't find type declared in code behind

G

Guest

This may seem a little silly but please bear with me...

I have a page called Page1.aspx and a code behind Page1.aspx.cs. In the
code behind I declare a class called OdsDataSource as a CHILD class of the
Page1 class, thus its full name is MyNamespace.Page1.OdsDataSource.

On the page I have an objectdatasource control with
TypeName="MyNamespace.Page1.OdsDataSource" when the page runs I get an error
saying that the ODS can't find the type specified for TypeName.

If I move this class out into the App_Code folder (therefore making it
MyNamespace.OdsDataSource) everything works fine. But if the class is
declared in my code-behind the ODS can't seem to find it.

I am suspicious that this has something to do with the web site compilation
model but I'm not sure.

How can I get the ODS to find a type declared in the code-behind?

p.s. Interestingly, if I set the ODS to use the page's type
(MyNamespace.Page1) it says it can't find that either, even though the page
is derived from it!! What is going on?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top