U can use System.Web.Helpers.Json.Encode() method to serialize your object to json string. And in your javascript you can use $.parseJSON(jsonString)
to deserialize it and use like javascript object.
public class Settings {
public double Width {get;set;}
public double Height {get;set;}
public string ToJson()
{
return Json.Encode(this);
}
}