Accessing the source code of an inaccessible Module


In this article, you will learn how to access the source code of a Module that is inaccessible when you try to edit it

This procedure is useful when you want to find which part of the code in the module is causing the error or if you need to get the CSS/HTML/content before deleting a faulty module. 

As an example, a possible error that you can get when trying to edit the Module could look like this: 

Error: is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Input string was not in a correct format. ---> System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at DotNetNuke.Modules.Admin.Modules.ModuleSettingsPage.OnInit(EventArgs e) --- End of inner exception stack trace ---



Step-By-Step Guide

  1. Go to (replace with your domain name). This should take you to the login page to login to your site.
  2. Log in as a Host/SuperUser account.
  3. Go to Persona Bar > SQL Console.
  4. Run this query
    select tabid, portalid, tabname, tabpath from tabs where tabname = 'Page Name'
    Note that you need to change Page Name for the name of the page associated with the Module that is inaccessible. 
  5. Write down the TabID from the output of the query in Step 3. 
  6. Run the following query
    select moduleid, header, footer from tabmodules where tabid = NumberCollectedOnStep4
    With this query, you are able to get the Header and footer source code of the Module (Second and third column).  
  7. Write down the ModuleID from the output of the query in Step 5 (First Column).  
  8. Run the following query
    select top 1* from htmltext where moduleid = NumberCollectedOnStep6 order by version desc
    The output of the query is the source code of the Module. 




Please sign in to leave a comment.