Download DOWNLOAD
Forums FORUMS
Blogs BLOGS
Forge FORGE
Help HELP
Marketplace MARKETPLACE
DotNetNuke Home
You are here >   Community > Forums
Register  |  Login

DotNetNuke Forums

DotNetNuke ForumDotNetNuke ForumArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0CanCan't reference controller from objectdatasource control
Previous
 
Next
New Post
5/18/2007 3:41 PM
 

Hi

I've been tearing my hair on this one.

I'm creating a module in 4.5.1. I've created a controller class in the desktop modules Components folder.

I'm now creating the view form. In VS2005 design view I've dragged an objectdatasource control. When I configure it in the IDE via the Configure data source option I'm presented with a choose a business object wizard. I'm then asked to choose the business object from a drop down but none seem to be available; I want my controller class to show up but it doesn't...

A clue here is displayed impling that the object should be defined in the bin or app_code directory. Well my business object (the controller) is in the components folder.

Can anybody tell me how I can get the business object to see the controller class in VS2005? So do I need to/how do I reference this somehow? Or perhaps I need to make the Components folder behave like the App_Code folder or something? Sorry I'm not used to individual assemblies... :).

Any help would be much appreciated..

Many thanks....


Alex Shirley
(BSc CEng MBCS CITP)

I recommend 3Essentials hosting, help me out by clicking here should you decide to purchase.

Alex Shirley


New Post
5/18/2007 5:34 PM
 

There is a bug in Visual Studio that your classes will not show up in the ObjectDataSource designer until AFTER you manually indicate it in the source code.

For example, if your class is called "YourCompany.Modules.ThingsForSale.ThingsForSaleController"

but this in the source of your .ascx file:

<asp:ObjectDataSource ID="ObjectDataSource_ThingsForSale" runat="server"
TypeName="YourCompany.Modules.ThingsForSale.ThingsForSaleController">
</asp:ObjectDataSource>

Then switch to the designer and it will work.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
New Post
5/18/2007 5:52 PM
 

Thanks Michael...

I tried this, I can select the drop down entry, but when I hit the next button I get a msgbox:

The type YourCompany.Modules.ThingsForSale.ThingsForSaleController could not be loaded. If the type is located in the App_Code folder, please check that it compiles. If the type is located in a compiled assembly, please check that the assembly is referenced by the project.

Could not load type YourCompany.Modules.ThingsForSale.ThingsForSaleController from assembly 'Microsoft.VisualStudio.Web'....

So I'm wonder where I should check the reference..?

Many thanks....!


Alex Shirley
(BSc CEng MBCS CITP)

I recommend 3Essentials hosting, help me out by clicking here should you decide to purchase.

Alex Shirley


New Post
5/18/2007 5:59 PM
 

Did you replace "YourCompany.Modules.ThingsForSale.ThingsForSaleController" with the name of your assembly? Also I think you have to compile your assembly so that it is avaliable in the /bin folder.

Also, are you using the WAP approach? I use the WSP (the Visual Studio default mode) so I am not up to speed on it's configuration.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
New Post
5/20/2007 2:39 PM
 

Yes I replaced YourCompany.Modules.ThingsForSale.ThingsForSaleController" (just referenced it here to simplify this post).

I have a solution set up with the main DNN code project and then the project module below this. If I look at the build output path for the module project it points to ..\..\bin\, and the module manifests itself in the main DNN code bin file. Whole solution builds/rebuilds fine.

If I change it to \bin, a "rebuild all" fails with a load of reference errors starting with "Could not locate the assembly dotnetnuke". However DotNetNuke appears to be referenced in the module project. If I change the build output path back to ..\..\bin\ it works again. Note the module is contained in the desktopmodules folder as expected.

Looking at the solution file there are no project dependencies set up, and the main Dotnetnuke project is set up as single startup project. Configuration properties are set as debug for both projects, the platform for the dotnetnuke project is set up as .NET and the module project as "Any CPU" (no option for .NET it seems).

Cheers!

Alex

p.s.

Just received the Building websites book last week you played a part in (after reading the Pro DotNetNuke 4 book). Very impressed... thanks Michael. I wish I read your book first! I think another book is required that contains the scope of chapters 6 to 9 approx 300-400 pages long, written in the style of "building websites" could make a great DNN programmers reference.


Alex Shirley
(BSc CEng MBCS CITP)

I recommend 3Essentials hosting, help me out by clicking here should you decide to purchase.

Alex Shirley


Previous
 
Next
DotNetNuke ForumDotNetNuke ForumArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0CanCan't reference controller from objectdatasource control

Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Networks

Follow DNNCorp on Twitter

LinkedIn

Follow us on Twitter @DNNCorp or join the DotNetNuke Community on LinkedIn

Sponsors

DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation

Hosted by MaximumASP