I have a javascript variable – type: var.
How do I pass this from the client side to the server side…and then use the value stored in the variable to do SQL queries in C# (asp.net)
(So far I have only done SQL queries with variables on the server side.)
and then after executing query, error checking; how do I return the result to the client side (javascript) and extract the useful information and apply it to my client side functionalities ?
Algorithm:-
1) accept var in client side 2) send request to server 3) accept on server side 4) use the query values (say firstname) and execute SQL query 5) check for result 6) if error then post error message else return result 7) accept result on client side 8) parse result and extract useful informatiom 9) use this information for client side functionalities.
Any ideas? Links with sample code ? What is this process formally called ? (maybe something like REST Web Service or other formalized names? )
Please help.
Thanks.
Var mem_ID = document.getElementById('<%=TextBox3.ClientID%>').value;
Now How do I pass this onto the server side??
What would work is an AJAX call to a server side aspx.net file. Have it return the text value you like and then on the client side the JavaScript can recieve it and do with it what you like.
This can be a complicated process. But that would be where you would begin your research.
Here’s a link to get started.