title: ASP.NET MVC 3 controller action for partial view
body: <p>I'm new to MVC and I don't understand how to use partial views correctly. I'm trying to display RSS feeds from a blog site in my MVC app. I'm using Razor and I have the following structure:</p>
  
  <pre><code>Controllers/HomeController.cs
  Controllers/RssController.cs
  
  Views/Home/Index.cshtml
  
  Shared/_Layout.cshtml
  Shared/_Rss.cshtml
  </code></pre>
  
  <p>HomeController:</p>
  
  <pre><code> namespace MvcApp.Controllers
      {
          public class HomeController : Controller
          {
              public ActionResult Index()
              {
                  ViewBag.Message = "Welcome to ASP.NET MVC!";
  
                  return View();
  
              }
  
          }
      }
  </code></pre>
  
  <p>RssController:</p>
  
  <pre><code>namespace MvcApp.Controllers
  {
      public class RSSFeedController : Controller
      {
  
          public ActionResult RssFeed()
          {
              string strFeed = "http://foo.wordpress.com/category/foo/feed/";
  
              using (XmlReader reader = XmlReader.Create(strFeed))
              {
                  SyndicationFeed rssData = SyndicationFeed.Load(reader);
  
                  return View(rssData);
              }
          }
  
      }
  }
  </code></pre>
  
  <p>_Rss.cshtml:</p>
  
  <pre><code>@using System.ServiceModel.Syndication;
  @using System.Text;
  @using System.Xml.Linq;
  
  &lt;h2&gt;RSSFeed&lt;/h2&gt;
  @foreach (var item in ViewData.Model.Items) 
  { 
  string URL = item.Links[0].Uri.OriginalString; 
  string Title = item.Title.Text;
  StringBuilder sb = new StringBuilder();
  foreach (SyndicationElementExtension extension in item.ElementExtensions)
  {
      XElement ele = extension.GetObject&lt;XElement&gt;();
      if (ele.Name.LocalName == "encoded" &amp;&amp; ele.Name.Namespace.ToString().Contains("content"))
      {
          sb.Append(ele.Value + "&lt;br/&gt;");
      }
  }
  Response.Write(string.Format("&lt;p&gt;&lt;a href=\"{0}\"&gt;&lt;b&gt;{1}&lt;/b&gt;&lt;/a&gt;", URL, Title)); 
  Response.Write("&lt;br/&gt;" + sb + "&lt;/p&gt;"); 
  }
  </code></pre>
  
  <p>_Layout.cshtml: </p>
  
  <pre><code>&lt;div id="main"&gt;
      @RenderBody()
  &lt;/div&gt;
  &lt;div id="BlogContent"&gt;
      @Html.Partial("_Rss");
  &lt;/div&gt;
  </code></pre>
  
  <p>My confusion is how do I call the controller action for getting the partial view?</p>