asp.net - 在Ajax Web服务中使用Umbraco Node工厂

标签 asp.net xpath asmx umbraco

我创建了一个.asmx Web服务,该服务通过Ajax调用。我用下面的代码

Node iLike = Node.GetCurrent().Parent as Node;
       Property Subject = iLike.GetProperty("emailToAdminSubject") as Property;
       Property BodyText = iLike.GetProperty("fbEmailToAdmin") as Property;


但是Node.GetCurrent()返回null。有什么方法可以获取asmx Web服务中的当前节点?

最佳答案

Node.GetCurrent()在Web服务的上下文中不起作用。 (请参阅此forum topic。)您可以使用ajax调用将当前节点的ID传递到Web服务,然后使用...

Node iLike = new Node(id).Parent;


...从那里。

关于asp.net - 在Ajax Web服务中使用Umbraco Node工厂,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10005278/

相关文章:

asp.net - Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) 在 ASP.Net 项目中返回空字符串

c# - GridView 中的更新行不起作用

xml - XPath 查询精确匹配

javascript - 努力处理从 jQuery 调用 vb.Net asmx Web 服务返回的数据

c# - 将 SOAP header 添加到 ASMX 服务请求

javascript - 升级.net框架后,Shield ui图表消失

c# - 依赖注入(inject)-通俗解释

python - 当下一个元素是文本时 xpath 中的异常

xml - XSL 副本中的 XPath 祖先和后代

c# - Web 服务无法使用 GAC 中的类型创建类型错误