RenderView() into a buffer.
Published on Sun 16 Dec 2007 12:12 ( 2 years, 2 months ago)
RenderView into a buffer and then we can do something on the result before output.
via: http://forums.asp.net/t/1193898.aspx
[ControllerAction]
public void About()
{
StringWriter interceptingWriter = new StringWriter();
TextWriter originalWriter = this.ControllerContext.HttpContext.Response.SwitchWriter(interceptingWriter);
RenderView("About");
originalWriter.Write("The text written was: " + interceptingWriter.ToString());
}
This is still raw, but we can have a customized controller class handle all those better.
Related posts:
- To "refresh" a SqlDataSource.
- asp:ControlParameter vs asp:FormParameter
- output a line in a batch *without* crlf
- Write code with no getters???
- Dump SQL Server Express' DB Schema
- My suggestions on Web2py's route design
- Good comparing of GAE Data Store .vs. Amazon Simple DB .vs. MS SSDS
- Very good articles on MVC, MVP and more.
- Presenter First approach in MVP
- ASP.NET MVC Preview 3 just released
Search related in web:
Custom Search