i use asp.net website with Ajax-Json-asmx
call. the webmethod tries to access Node.GetCurrent() to get a Node ID
for a property. but "Null reference exception" is thrown. below is the
code.
Well because you're in a handler it doesn't know what the current page is. I think it's best to pass the current node id to your ajax call and than get it there.
ok, Thanks for your reply. You mean to say pass the "Node Id" or the Id which gets generated by this code - Node.GetCurrent().GetPropertyValueRecursive("intLinkHome").
Ajax-Json-Asmx + Node.GetCurrent() "Null reference exception"
Hi all,
i use asp.net website with Ajax-Json-asmx call. the webmethod tries to access Node.GetCurrent() to get a Node ID for a property. but "Null reference exception" is thrown. below is the code.
Response.Redirect(
umbraco.library.NiceUrl(
Convert.ToInt32(Node.GetCurrent().GetPropertyValueRecursive("intLinkHome"))));
Is tehre any way to get the node id in ajax call from umbraco. Thanks in advance for the help.
Well because you're in a handler it doesn't know what the current page is. I think it's best to pass the current node id to your ajax call and than get it there.
Jeroen
ok, Thanks for your reply. You mean to say pass the "Node Id" or the Id which gets generated by this code - Node.GetCurrent().GetPropertyValueRecursive("intLinkHome").
Thanks
I mean pass in the node id.
In your code pass Node.GetCurrent().Id to your ajax call. In there you can do new Node(id).GetPropertyValueRecursive("intLinkHome") to get the value.
Jeroen
Thanks Jeroen... It worked... :)
is working on a reply...