'ASP.NET Saving Data
So I have a basic crud that displays information on ASP.Net using entity framework. When i click details it shows the information for that row on a table. I've input a button and a label that when is clicked shows a number, when clicked again it will show the next number higher. It's basically to just a button counter written with JQuery. My question is, is there a way to save this number? I want to store the data in the program so it doesn't forget the number when I move to a different page.
Here is the JQuery.
var count = 0;
function Count() {
count++;
$('#lblShow').text(count);
}
<div>
<input type="submit" name="btnCount" value="Add Signature" onclick="return Count();" id="btnCount" /> <input type="submit" name="btnCountSoc" value="Post to Social Media" id="btnMedia" />
<span id="lblShow"></span>
</div>
Any advice would be appreciated, thanks.
Solution 1:[1]
You can use cookies like :
var counter = $("#foo").val();
document.cookie = "counter="+counter";path=/";
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mhhabibi |
