I want to show news on my main page using Rss Feeds. I want to show news somewhere in side panel. How i will use PartialViews to show it?
public ActionResult Feed() { string feedUrl = "http://www.gadgetfind.com/rss.xml"; XmlReader reader = XmlReader.Create(feedUrl); SyndicationFeed feed = SyndicationFeed.Load(reader); return View(feed); }
In ASP.NET MVC 2 you can use RenderAction
:
<% Html.RenderAction("Feed", "MyController"); %>
Phil Haack wrote a nice blog post about this topic.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.