Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived 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 6: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


 
New Post
5/18/2007 8: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 8: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


 
New Post
5/18/2007 8: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 5: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


 
Previous
 
Next
HomeHomeArchived 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


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out