您是否考虑过通过一些 Web 服务调用或其他方式将数据存储在数据库中?为什么不每次导航到新页面时都调用 Ajax 来存储和检索数据?
$(document).ready(function () {
$.ajax({
type: "POST",
url: "/Services/SomeServiceService.asmx/GetData",
data: "{ 'myval' : 'someval'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (resp) { alert("ERROR\n" + resp.responseText); },
success: function (data) {
}
});
$(".next").click(function(event){
$.ajax({
type: "POST",
url: "/Services/SomeServiceService.asmx/SaveData",
data: "{ 'myval' : 'someval'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (resp) { alert("ERROR\n" + resp.responseText); },
success: function (data) {
}
});
});
});