I am using this Ajax code. But I dont know how i will retrieve my value of value1 on my server-side asp using Javascript.
On my serverside I want to have something
Whatever the server-side script outputs will be picked up by the AJAX request. So if the AJAX requests something, the server-side does the legwork and fetches the result from the database and then outputs it.
There are loads and loads of tutorials on how to do exactly this. Just ensure that you secure your script properly so that it's not open to abuse.