views:

41

answers:

2

Hi,

i have a method that returns a list of serialized objects in my page code behind

private string Get()
{
    JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer();
    string jsonString = SerializeToJason(UnavailabilityBusiness.Get(new DateTime()));
    return  jsonString ;    
}

i would like to pass this serialized objects to javascript

function getJson()
{
     ??????
}

How do I do it?

A: 

You could write them out as a script, typically leveraging ClientScript.

You would want to take care to register the script so that it renders before the consuming script.

Sky Sanders
Could you give an example please, i have tried everything i thought could have worked
GigaPr
@GigaP - sorry, I missed your request. Did you get it going or do you still need some guidance?
Sky Sanders
A: 

Looks like this guy wrote a utility class to do what you're trying to do (Code Project Link).

I have't really looked at it but you can get his source and have a look.

Good luck,

Patrick.

Patrick