Wednesday, October 29, 2014

I'm am "learning" that one may hand an HttpContext into a method signature to empower a Response.Redirect outside of a web form in a standalone class in C#.

myHttpContext.Response.Redirect(url); would then be the way to do the act. However, this may not be the smartest thing. Response.Redirect does not play nicely with ASP.NET MVC and thus abstracting a redirect out of the UI to other code may just not be smart. (What if you change out the UI or let other UIs talk to your class?) These mechanics belong in their UI implemenations.

No comments:

Post a Comment