得到错误:CS1061 [英] Getting error: CS1061
问题描述
请参阅结果
<一href=\"http://stackoverflow.com/questions/369794/good-and-full-implementation-of-rss-feeds-in-asp-net-mvc\">http://stackoverflow.com/questions/369794/good-and-full-implementation-of-rss-feeds-in-asp-net-mvc
检查特雷弗·德Koekkoek的答案。
Check the answer of Trevor de Koekkoek.
我得到这个错误
CS1061:'对象'不包含'物品',没有扩展方法项目接受型对象的第一个参数的定义可以找到(是否缺少using指令或程序集引用)
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?)
推荐答案
你得到的观点,即错误?在这种情况下,你需要让你的看法与SyndicationFeed强类型的模型。
Do you get that error in the view ? In that case, you need to make your view strongly typed with SyndicationFeed as your model.
这意味着你应该声明您的视图(的.aspx)沿着线的东西:
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>" %>
这告诉ViewData.Model的类型SyndicationFeed,这样就可以在不投访问它的属性和方法的看法。
This tells the view that the type of ViewData.Model is SyndicationFeed, so that you can access its properties and methods without casting.
这篇关于得到错误:CS1061的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!