I'm using Json.NET to deserialize a jQuery.post() JSON param.
The raw value that's posted back is in the following format
jobs=4-5-6-7&invoiceDate=04-05-11
The class I'm trying to deserialize into is
public class InvoiceRequest
{
public DateTime InvoiceDate { get; set; }
public string JobList { get; set; }
}
And the code I'm using for this is
var sr = new System.IO.StreamReader(Request.InputStream);
var line = sr.ReadToEnd();
var deserializedProduct = JsonConvert.DeserializeObject<InvoiceRequest>(line);
The problem is that nothing happens when that third line is hit. When I step through the code, it reaches that line and then... nothing. The stepper disppears and the page never receives any response.
Can anyone explain what I'm doing wrong here?