tags:

views:

329

answers:

1

Refer to
http://stackoverflow.com/questions/369794/good-and-full-implementation-of-rss-feeds-in-asp-net-mvc

Check the answer of Trevor de Koekkoek.

I am getting this error CS1061: 'object' does not contain a definition for 'Items' and no extension method 'Items' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

A: 

Do you get that error in the view ? In that case, you need to make your view strongly typed with SyndicationFeed as your model.

This means you should declare your View (.aspx) as something along the lines of:

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<System.ServiceModel.Syndication.SyndicationFeed>" %>

This tells the view that the type of ViewData.Model is SyndicationFeed, so that you can access its properties and methods without casting.

driis