tags:

views:

37

answers:

3

Hi,

So I have an asp.net 2.0 web application and I created a web service to post some data from a web form to a database. I now want to use jQuery/AJAX to post the data to the server but since the application is 2.0 and not 3.5+ I don't have the System.Web.Script.Services.ScriptService namespace which seems to be needed (I am posting JSON objects)?

Is there a workaround for this (without upgrading the web application to 3.5)?

Thanks in advance.

EDIT I installed http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en and restared VS2010 but can still not use the namespace.

+1  A: 

Use Ajax. And include in your project the JSON.NET free library for JSON Serialization/Deserialization for the server side code.

For the client side just use JSON in javascript

Lorenzo
I am using ajax and json but I can't call the webmethod in my web service from client script without the System.Web.Script.Services.ScriptService namespace. http://www.asp.net/ajax/tutorials/understanding-asp-net-ajax-web-services "To allow JSON calls to be made you have to apply the ASP.NET AJAX Extension's ScriptService attribute to the Web Service class. "
Morgan
Yes that's true. I did not understande your question very well at the beginning. I thought you had problems in serializing/deserializing field. Just read too fast... If you're using webforms I think you shall upgrade to .net 3.5 at the least... As drachenstern wrote in the comment: why you dont want to upgrade?
Lorenzo