简体   繁体   中英

DotNetNuke Location for ObjectDataSource for Module

I'm creating a DNN module. I have an ascx control. It has an ObjectDataSource. When I try to "Configure Data Source..." my source type is not in the dropdown. The instructions in the dialog says, "Select a business object that can be used to retrieve or update data (for example, an object defined in the Bin or App_Code directory for this application)." However, there is no App_Code folder because I'm not creating a web site but rather a DNN module. This is not being coded directly into the site (please don't tell me that that's how I should be doing it--I don't have the option of changing that).

I also tried putting the class into a totally separate class library and referencing that but that didn't help either.

Then I simply typed in the TypeName manually (using the fully qualified namespace) and that didn't work either. It compiled, but the DNN site itself threw, "The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource1' could not be found." and in the "Configure Data Source..." (which I invoked after manually typing in the type) showed up with the type I typed in in the dropdown but then when I'd try to click Next, I'd get the error "The type...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."

So, my question is simply, where do I put the ObjectDataSource's data source type class for a DNN module?

I would encourage you to use the methods built-in to DNN to handle things like this. That includes including any data and tables in the DNN database, and using the DNN DAL methods to access data.

I highly recommend the module templates available via christoc.com. You will also find tutorial links there, as well as at dnnsoftware.com, dnnhero.com, and dnncreative.com.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM