[英]System.Xml.Linq.XElement' does not contain a definition for 'XPathEvaluate
I'm trying to query an Xelement value passed in through model data and I'm getting the following error 我正在尝试查询通过模型数据传递的Xelement值,但出现以下错误
var hello1 = (string)this.Model.hello.XPathEvaluate("/hello/helloworld]");
Namespaces in web.config: web.config中的命名空间:
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Xml.Linq" />
<add namespace="System.Xml.XPath"/>
</namespaces>
I ended up removing the references from the config file and added it it directly to the page, @using System.Xml.Linq; 我最终从配置文件中删除了引用,并将其直接添加到页面中,@ using System.Xml.Linq;。 @using System.Xml.XPath;
@using System.Xml.XPath;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.