Author: raf_c | Posted on: 3/7/2010 3:20:17 PM | Views : 653

I try to build a drag and drop page dynamically with ajax. When a user drops a dragable div at a specific place, some other divs has to be created according to some data in a database. I have a php background where i did the same thing using prototype.js and json data serialisation. As i'm new to asp.net and C#, this is my first post.

What i want is the server to return a JSON string of data which i can parse in my javascript functions. Is a webservice the way to go? And how can i convert my sql data into a JSON string? Do i have to write a ToJSON function myself?
In C# i have the following code:

[WebMethod]
public string test()
{
SqlConnection myConnection = new SqlConnection("user id=xxx;" +
"password=yyy;server=BUREAU\\SQLEXPRESS;" +
"Trusted_Connection= ...

Go to the complete details ...