简体   繁体   English

模块的ObjectDataSource的DotNetNuke位置

[英]DotNetNuke Location for ObjectDataSource for Module

I'm creating a DNN module. 我正在创建一个DNN模块。 I have an ascx control. 我有一个ascx控件。 It has an ObjectDataSource. 它具有一个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)." 对话框中的说明说:“选择可用于检索或更新数据的业务对象(例如,在此应用程序的Bin或App_Code目录中定义的对象)”。 However, there is no App_Code folder because I'm not creating a web site but rather a DNN module. 然而, 没有 App_Code文件夹,因为我不是建立一个网站,而是一个DNN模块。 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. 然后,我只是简单地手动键入TypeName(使用完全限定的名称空间),但这也不起作用。 It compiled, but the DNN site itself threw, "The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource1' could not be found." 它进行了编译,但是DNN站点本身抛出“找不到ObjectDataSource'ObjectDataSource1'的TypeName属性中指定的类型”。 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." 并在“配置数据源...”(我在手动键入类型后调用的数据)中显示了我在下拉菜单中键入的类型,但是当我尝试单击“下一步”时,我会收到错误消息“类型...无法加载。如果类型位于App_Code文件夹中,请检查它是否可以编译。如果类型位于已编译的程序集中,请检查项目是否引用了该程序集。”

So, my question is simply, where do I put the ObjectDataSource's data source type class for a DNN module? 因此,我的问题很简单,我应该将ObjectDataSource的数据源类型类放在DNN模块的哪里?

I would encourage you to use the methods built-in to DNN to handle things like this. 我鼓励您使用DNN内置的方法来处理类似的事情。 That includes including any data and tables in the DNN database, and using the DNN DAL methods to access data. 这包括在DNN数据库中包括所有数据和表,以及使用DNN DAL方法访问数据。

I highly recommend the module templates available via christoc.com. 我强烈推荐可通过christoc.com获得的模块模板。 You will also find tutorial links there, as well as at dnnsoftware.com, dnnhero.com, and dnncreative.com. 您还将在dnnsoftware.com,dnnhero.com和dnncreative.com上找到教程链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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