As it says in the title I want to have a button/link that when clicked it adds a number to a table in a database but stays on the same page without refreshing the page. It would also be nice if it said “Thanks” after clicking.
I was thinking that I could use some sort of JavaScript thing to do it.
I am using C# and aspx.
Yes, you can do this with an AJAX postback.
With jquery:
http://api.jquery.com/jQuery.ajax/
Depending on your server-side framework, your back-end method may have to be setup slightly differently. Here’s one example using webforms.
You can update the
successorcompletecallback method of theajaxcall to update the DOM oralert('Thanks')for completed behavior, too.