Problem with Objectdatasource and project less solution.

P

Prasanta

Hello,

I have a project less solution asp.net 2.0 with c#. I have a method in
page code behind which returns a datatable, that method I want to
assign in the objectdatasource select method, but when ever I am
passing the typename in objectdatasource with the class name its
saying couldn't find the type. but if the solution is not projectless
same code is working fine, is there anything extra need to be done on
the page or objectdatasource.


Cheers,
PB
 
S

Stan

Hello,

I have a project less solution asp.net 2.0 with c#. I have a method in
page code behind which returns a datatable, that method I want to
assign in the objectdatasource select method, but when ever I am
passing the typename in objectdatasource with the class name its
saying couldn't find the type. but if the solution is not projectless
same code is working fine, is there anything extra need to be done on
the page or objectdatasource.

Cheers,
PB

Really the code for the ObjectDataSource select, update, delete,
insert methods should be contained in a separate class file in the
App_Code folder. When the ObjectDataSource executes these methods it
creates an instance of the class. If the code for these methods is
within the page code-behind then merely assigning the method names to
the ObjectDataSource will not work because it will expect a class name
reference.

You don't need a host project to do this. It works perfectly well
within a single web-site in the solution.
 

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

Top