在DNN的Forums上看到的对通用模块开发遇见的一些错误的回答

本文详细解析了DotNetNuke(DNN)模块在升级过程中遇到的多种常见错误,包括模块加载异常、缓存设置不当、数据库操作失败、用户实例生成错误等问题,并提供了具体的修正方法,帮助开发者有效解决DNN模块运行中遇到的技术难题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

文章的来源:http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/100778/scope/posts/Default.aspx

Error:

DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for 'MyModule.DataProvider' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MyModule.DataProvider' threw an exception. --->

Answer:

This is caused by upgrading your module from DNN3 to DNN4. In your dataprovider, Change:

CType(Framework.Reflection.CreateObject("data", "MyModule", "MyModule.dll"), DataProvider)

To:

CType(Framework.Reflection.CreateObject("data", "MyModule", ""), DataProvider)

 Error:

The module works fine when logged in as an administrator, but when a normal user uses it they do not get the post back click event or the page doesn't refresh.

Answer:

The module has caching enabled. Set the caching to 0 and click the update link in the module configuration settings for the module.

Error:

'ExecuteSQL' is not a member of ... 

Answer:

Use DotNetNuke.Data.DataProvider.Instance().ExecuteSQL...

 

Error:

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

Answer:

Caused when using SQL Server express. In the web.config, change:

 <add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />

to:

 <add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
   

 

Error:

Exception has been thrown by the target of an invocation ... 

Answer:

If you have code that calls the database, ensure that a value is being returned fron the databse. Otherwise you will get this error.

Error:

The PopupControlExtender places the popup in the wrong place when the page is scrolled

Answer:

 

 

When the page scrolls, the popup control will lose position unless you place the items in a panel and give it a CssClass class like:

 

 

< asp:Panel ID="pnlUsers" runat="server" Height="50px" Width="125px" CssClass="PanelExtender" >

Then you give that .css class a  position of relative like:

< style >
.PanelExtender
{
    position: relative;
}
< /style >


Michael Washington
* ADefWebserver.com
* DNN Module Developer's Guide
* IWEB - DNN Web Services
* Silverlight and DotNetNuke

转载于:https://www.cnblogs.com/GDLMO/archive/2007/12/23/1011785.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值