Problem with Objectdatasource and project less solution.

  • Thread starter Thread starter Prasanta
  • Start date Start date
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
 
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.
 
Back
Top