Click here to Skip to main content
16,017,261 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to insert data into database by using java script in asp.net
Posted

Well, it really depends on where the database is. If it's a client side database I would recommend using the Indexed DB[^] approach. If it's a server side database, then I would recommend using AJAX to transmit a request to a server side method (I like RESTful services for this) and let the server side code manage the insert. For this approach, search on AJAX REST JavaScript and insert the database of your choice in here as your search terms.
 
Share this answer
 
Comments
Member 10378142 11-Feb-14 6:19am    
can you please tell me how to use AJAX REST
Pete O'Hanlon 11-Feb-14 6:22am    
Well, I did tell you the search terms to plug into Google. As you said please, however, here's a Google search to start you off: https://www.google.co.uk/search?q=AJAX+REST+JavaScript&oq=AJAX+REST+JavaScript&aqs=chrome..69i57.2680j0j8&sourceid=chrome&espv=210&es_sm=122&ie=UTF-8. If you include the database that you are using as part of the search term, you should be able to narrow this down even further.
Member 10378142 11-Feb-14 6:29am    
can we create a session in javascript
Pete O'Hanlon 11-Feb-14 6:34am    
The session should come from the web server - you shouldn't try to create it at the client side because the server will have no understanding of it.
Member 10378142 11-Feb-14 6:37am    
Thanks for replying .. iam having a variable in javascript which is existed in .aspx page i want to call that variable into the textbox in c# can u suggest me please
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900