Patrick, I looked through your code and saw how you did it and got some ideas.
This is what I came up with.
The "Dispatch" module just inspects the query string and if it finds the uvcmid param, it calls the same methods that the module instance would eventually call if fully rendered:
I guess I could do this on a separate .aspx page too if needed.
public class UVcWebTransformRSSDispatcher : PortalModuleControl {
protected Label RSSDispatcherMonitor;
protected override void OnInit(EventArgs e)
{
// Check whether the query string contains a parameter for a module instance.
// If it does, load up a UVcWebTransformParameters instance with the settings
// from the database and call Execute the transformation.
try {
int ModuleId = System.Int32.Parse(Request.QueryString["uvcmid"].Trim());
Hashtable h = PortalSettings.GetModuleSettings(ModuleId);
UVcWebTransformParameters uvp = new UVcWebTransformParameters(h, Response);
string rv = UVcWebTransformPerformTransform.Execute(uvp);
// Assume valid RSS returned from execution
Response.Clear();
Response.ClearHeaders();
Response.ContentType = "text/xml";
// Fake it for now:
Response.Write("<rss>\nthis is my rss for: " + (string) h["DataSourceURI"] +
"<content>\n<![CDATA[" + rv + "\n]]>\n</content>\n</rss>");
Response.End();
} catch (Exception ex) {
RSSDispatcherMonitor.Visible = true;
RSSDispatcherMonitor.Text = "Unable to process request due to an error:<br />" + ex;
base.OnInit(e);
}
}
}
ASP.NET/C# Developer