Earlier i was displaying some webservice data inside umbraco site by creating Macro using usercontrol. In usercontrol i am getting data form webservice and using that usercontrol for creating Macro.
Now my client is saying that he doesn't want to create macro using usercontrol, he want to create using Razor.
So can anyone please guide me how to use webservice inside Razor for displaying data.
How to use web service inside Razor
Hi,
Earlier i was displaying some webservice data inside umbraco site by creating Macro using usercontrol.
In usercontrol i am getting data form webservice and using that usercontrol for creating Macro.
Now my client is saying that he doesn't want to create macro using usercontrol, he want to create using Razor.
So can anyone please guide me how to use webservice inside Razor for displaying data.
Thanks in advance.
Rajan
Yes this is possible and the c# code itself will be almost identical. In the top of your razor you would declare a code block:
@{
// Write code that gets data from web-service here.
}
<!-- Render HTML from web-service data here using variables declared above -->
Does that make sense?
is working on a reply...