Search Results

Search found 2 results on 1 pages for 'johnrudolflewis'.

Page 1/1 | 1 

  • Render view as string then redirect.

    - by JohnRudolfLewis
    In my ASP.NET MVC application, I would like my controller action to render a view to a string, send an email using that string as the body, then do a redirect. I've found several articles here on SO and elsewhere on how to render the view to a string. That part was easy. But when I attempt to perform the redirect, I get an HttpException: Cannot redirect after HTTP headers have been sent. I've tried setting Response.Buffer and Response.BufferOutput to true, I've tried Response.Clear, nothing seems to work. Is it possible to render a view to a string, then do a redirect?

    Read the article

  • Is it possible to write an IIS URL Rewrite Rule that examines content of HTTP Post?

    - by JohnRudolfLewis
    I need to split a portion of functionality away from a legacy ISAPI dll onto another solution (ASP.NET MVC most likely). IIS7's URL Rewrite sounded like a perfect candidate for the job, but it turns out I cannot find a way to configure the rules the way I need. I need to write a rule that examines the content of the HTTP post for a particular value. i.e. <form method="post" action="legacy_isapi.dll"> <input name="foo" /> </form> if (Request.Form["foo"] == "bar") Context.RewritePath("/some_other_url/on_the_same_machine/foo/bar"); As a proof of concept, I was able to create an IHttpModule that examines context.Request.Form collection and performs a rewrite when certain parameters are present. I installed this module in my website, and it works. Rather than a custom module, however, I'd rather extend the existing URL Rewrite module to support examining the content of the HTTP Post as one of its rules. Is this possible?

    Read the article

1