Home » Posts tagged "json"

ASP.NET JSON and ViewState

imageI received the following question recently about my article “ASP.NET AJAX using JSON – Here’s how.

If we update the value of a textbox or label via a JSON web service call – will the value of that textbox/label be written to the viewstate or whatever so that the server side code can see the new values that came from the JSON request?

The short answer is, “no, it will not update viewstate.”  But I think it would be helpful to understand when this is important rather than just giving you a blanket answer.

Continue reading “ASP.NET JSON and ViewState”

ASP.NET AJAX using JSON – Here’s how.

image Last week I wrote a post about how simple JSON is. In it I explained the main differences between using JSON and using the update panel. I really started out thinking I’d get to how to write JSON code, but I ran out of space. Well, today, we get to the HOW.

All JSON really is, is the ability to have JavaScript code call a WebService for our data, and write it into the HTML on the client side. If you know anything about how to write a WebService, this should be rather trivial because your web service is going to look just like any other web service with the exception of an added attribute.

Continue reading “ASP.NET AJAX using JSON – Here’s how.”