Friday, November 27, 2009

How to access Html.RenderAction

This is my first blog and I plan on using this site for my own personal reference later on, and maybe help a few other people along the way who run across the same problems...

So I, among others, have been trying to find the Html.RenderAction() function. Here's the steps I went through in order to get it to work...

  1. Create an "ASP.NET MVC Web Application" project.
  2. Download the Microsoft.Web.Mvc.dll here.
  3. Add a reference on your project to Microsoft.Web.Mvc.dll
  4. Open your web config and find the <namespaces> section which is located in the <pages> section. Add this to the <namespaces> section: <add namespace="Microsoft.Web.Mvc" />
  5. Build your project so intellisense will pick up the function.(This is the part that was tripping me up, don't always believe your eyes, the function is there.)
  6. Now you should be able to use Html.RenderAction in your views.
  7.