After little bit of workaround I managed to get value in Javascript.
What I did is:
make a property in my custom model
set that property from controller using IPublishedContent node = UmbracoContext.Current.ContentCache.GetByRoute("/requestquoteemailtemplate/");
string mailHtml = node.GetPropertyValue("emailTemplateHtml").ToString();
set window.currentTemplateModel with my custom model in View
get property in javascript like this : window.currentTemplateModel.raqEmailTemplateHtml
May it can help anyone to solve this kind of issue.
How to get Umbraco content node in Javascript
Hi,
I am using Umbraco 7.2.4.
I need to get a Umbraco content node in Javascript file. So that I can get properties of it.
How can I do that?
Can any one have idea?
Thanks in advance.
Regards,
Urvish Mandaliya
My aim is to get value from view to javascript or else if I can access Umbraco node in Javascript than I can fetch node properties.
Hi,
After little bit of workaround I managed to get value in Javascript.
What I did is:
IPublishedContent node = UmbracoContext.Current.ContentCache.GetByRoute("/requestquoteemailtemplate/"); string mailHtml = node.GetPropertyValue("emailTemplateHtml").ToString();
window.currentTemplateModel
with my custom model in Viewwindow.currentTemplateModel.raqEmailTemplateHtml
May it can help anyone to solve this kind of issue.
Regards,
Urvish Mandaliya
is working on a reply...