concept RssWidget in category c#

appears as: RssWidget, RssWidget
ASP.NET MVC 4 in Action

This is an excerpt from Manning's book ASP.NET MVC 4 in Action.

Figure 19.3 shows the Visual Studio structure for the RssWidget portable area.

Figure 19.3. Layout of the RssWidget portable area

The RssWidget project shown in figure 19.3 contains all the files that are part of this portable area. The interesting difference between this RssWidget example and the previous example is the addition of the SyndicationService and the HtmlHelperExtensions classes. This example demonstrates that you can include a complete feature in a portable area. We’ve found that by including custom HTML helpers in the projects, the ease of use for the area increases significantly.

Figure 19.3. Layout of the RssWidget portable area
ASP.NET MVC 2 in Action

This is an excerpt from Manning's book ASP.NET MVC 2 in Action.

Consider a portable area that would provide a web page widget for rendering an RSS feed as an unordered list. We’ll walk through an example and look at how we can add a helper to make the portable area easier to use. Figure 22.3 shows the Visual Studio structure for the RssWidget portable area.

Figure 22.3. Layout of the RssWidget portable area

The RssWidget project shown in listing 22.3 contains all the files that are part of this portable area. The interesting difference between this RssWidget example and the previous example is the addition of the SyndicationService and the HtmlHelperExtensions classes. This example demonstrates that you can include a complete feature in a portable area. We’ve found that by including custom HTML helpers in the projects, the ease of use for the area increases significantly. Let’s walk through the code.

Listing 22.3. RssWidget registration
Listing 22.5. View for the RssWidget.Index action
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage< System.ServiceModel.Syndication.SyndicationFeed>" %> <ul> <%foreach(var item in Model.Items) {%> <li> <%=item.Title.Text %> - <%=item.Authors[0].Name %> </li> <%} %> </ul>

22.5. Distributing the RssWidget

We’ve covered how to create the widget and how to use it from an MVC application. The one missing piece is distributing the RssWidget portable area.