0
votes

I have created a custom grid module MySQLGrid using Web Application Project, assembly file MySQLGrid.dll is in DNN bin folder. Alone it is working good. Now i want to use it within another module. I read somewhere that to use a module inside another module, we need to register it first.

So first i created a TestGrid.ascx module, then register MySQLGrid as below

<%@ Register TagPrefix="msg" Assembly="MySQLGrid" Namespace="Samtech.Dnn.Modules.MySQLGrid"%>

and create control on page as

<msg:View id="mygrid" runat="server" />

But when i install and test TestGrid module in DNN, it is showing following error

Error: Test Grid is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---

What is the correct way to re-use compiled module inside another?

1
I changed registration block as <%@ Register TagPrefix="msg" TagName="SQLGrid" Src="~/DesktopModules/MySQLGrid/View.ascx" %> now module is rendering as usercontrol in designer but still not loading in DNN and giving error. - SamTech

1 Answers

1
votes

Anyways problem has been resolved. I register module as

<%@ Register TagPrefix="msg" TagName="SQLGrid" Src="~/DesktopModules/MySQLGrid/view.ascx" %>

now it is working properly. There was a problem in testgrid module that was preventing it from displaying.