Tuesday, August 31, 2010

Broken AspView Sending Emails

One more broken thing I've noticed and had to fix in the source - you cannot send emails when using a layout (non-deprecated methods) from monorail. In order to fix this, I had to change one line in the asp view source. In AspViewEngine.Process(string, string, TextWriter, IDictionary):

Process(templateName, output, null, null, controllerContext);
changes to
Process(templateName, output, EngineContextLocator.Instance.LocateCurrentContext(), null, controllerContext);

The problem was that the context being passed into the next process step was null, and I was getting a null object ref when trying to send an email. With this fix in place, everything works as expected. Not sure if this is an oversight on the AspView creator's part or just an odd chain of events.

No comments:

Post a Comment