Loading Modular ASP.NET Components at Runtime
<p>I'm building an ASP.NET website that will act as a "framework" and display information about some services that are running on the web server. One of the things that the site needs to do is serve up custom configuration pages for some modules that have been loaded by the service. The modules will all implement a common API, so there is no concern there -- my concern is how can I get configuration pages, which are unique to each module, served up by a common front end? </p>

<p>The pages need to validate user input, handle button clicks, etc. So it's not as simple as having a method on each module:</p>

<p><code>public string getHTMLConfigPage()</code></p>

<p>That would only work if the module's config page didn't require user input. In this case, all of the modules will require some form of configuration, at the very least a checkbox indicating "turn on/off"</p>

<p>Here's the ideal use case:</p>

<ol>
<li>At run time the IIS process talks to the back end service and figures out there are N modules running</li>
<li>The server adds links for these N # modules to a drop down menu</li>
<li>When the user clicks the menu item for a module, the module's configuration page is displayed</li>
<li>The user configures the module however they wish, with the individual module controlling that entire sequence</li>
</ol>

<p>We've already implemented this successfully in C# winforms. The way we did it there was to have each module implement a method <code>public void showConfigDialog(IWin32Window parent);</code>. That works well  for a regular desktop app -- but obviously doesn't help me do anything with the web server.</p>

<p>The only thing that I have thought of so far is to have each module also install some stuff onto the IIS web server, and then just do an <code>iFrame</code> where the main "framework" page can display the module's page in the frame (or a popup window), but that seems messy in that the module developer has to then include some kind of setup scripts to put stuff into the IIS space... </p>

<p>So - is there a better way to do this, or is the iFrame method the only way?</p>

<p><strong>Systen Details:</strong></p>

<ul>
<li>ASP.NET 4.0</li>
<li>C# .NET 4.0</li>
<li>IIS 7.5 (Server 2008 R2)</li>
</ul>

<p><strong>EDIT: Additional Details</strong></p>

<p>I have  also thought about having the modules place a  special ASP.NET DLL in a directory that ASP.NET will probe at runtime. But the root of the problem remains -- how can the DLL provided by module get integrated into the main set of web pages? The main set of web pages have a <code>Site.Master</code> page that provides some required items (CSS, menu bar, some jQuery addons, etc.). The DLLs from the modules will likely need this information plus a named pipe that the main web pages use to talk back to an underlying windows service we have written.</p>
