Working with Umbraco Node factory in ajax webservice
I have created an .asmx web service that I call via Ajax. i used the following code
Node iLike = Node.GetCurrent().Parent as Node;
Property Subject = iLike.GetProperty("emailToAdminSubject") as Property;
Property BodyText = iLike.GetProperty("fbEmailToAdmin") as Property;
but Node.GetCurrent () returns null. is there a way to get the current node in the asmx web service?
+3
Ajmal VH
source
to share
1 answer
Node.GetCurrent () will not work in the context of a web service. (See this section.) You can pass the current node id to the web service with your ajax call and then use ...
Node iLike = new Node(id).Parent;
... from there.
+1
Douglas ludlow
source
to share