Returning String as ActionResult in ASP.Net MVC



I am learning ASP.Net MVC now and loving it. If you to read more praises about ASP.Net MVC search for MVC on StackOverflow.

Ok. Not every time you may want to return a View for an action. Sometimes, you must just return some XML or string.

To do this just use the this.Content function to return ActionResult.

return this.Content("Your string here")

Thanks.



ASP.Net MVC for Beginners/Dummies



If you are just starting with ASP.Net MVC (Model View Controller) framework then here are the must read articles to learn the basics. These articles will get you clear picture about the framework.

ASP.NET MVC Framework (Part 1)
ASP.NET MVC Framework (Part 2) – URL Routing
ASP.NET MVC Framework (Part 3) – Passing ViewData from Controllers to Views
ASP.NET MVC Framework (Part 4) – Handling Form Edit and Post Scenarios

Thanks.