Meengla Meengla - 2 months ago 5
ASP.NET (C#) Question processing of .CFM files or Redirects from .cfm to .aspx page?

I have a legacy .cfm (ColdFusion) page which used to process form data (from remote servers) and send users emails based on form data. Now I no longer use ColdFusion and instead hosting is at the 'free' ASP.NET (3.5). I am not sure how much control I have over that. But I was thinking if I can have a global.asax file where all requests (actually, form posts) going to the .cfm page get redirected to an aspx page where I can do the needed processing.
How can this be done within a shared hosting providers limitations? I know I can create a Virtual Directory in IIS. For example, can be directed to


Koby Mizrahy was close to helping me. My problem was that I was running Blog Engine .NET 2.0 as the main application of my website in GoDaddy's IIS Classic Mode. So the .cfm extension were not processed by the ASP.NET engine and hence no changes to either Web.Config or Global.asax were helping. I had to change to Integrated mode. Here is what I did to fix:

In Web.Config, added this in the 'Handlers' node to make sure Form Posts to .cfm would be processed, otherwise I got some 405 error.

 <add name="ColdFusion" path="*.cfm" verb="*" type="System.Web.StaticFileHandler" resourceType="Unspecified" preCondition="integratedMode" />

Then in global.asax, I had this in the Application_beginrequest handler

if (Request.Url.ToString().Contains("TourEmail-act.cfm"))// 

Problem solved! Thank you very much Mizrahy!