我陷入了一种情况,网站在ASP.NET 1.1中运行
我正在加载一个包含一些数据的页面。在页面中有一个 Html 表。 在每一行中,我在一个中加载状态(活动/非活动),在另一个中加载消息。
单击时有一个保存按钮,它应该将状态和消息保存到数据库。
由于数据在Html 表中,因此单击按钮时我会丢失数据。
我尝试了一种将页面加载时的状态和消息保存在全局 Javascript 变量中的选项。但是当单击按钮时,我也会松开它。
存储数据的 JS 代码:
// To store all active or inactive feature values.
var arrType = [];
var interiorValues = [arrType];
var exteriorValues = [];
var mechanicalValues = [];
var standardValues = [];
function StoreChromeVallue()
{
var $jDecode = jQuery.noConflict();
var table = document.getElementById('dlInterior');
for (var i = 1, row; row = table.rows[i]; i++)
{
for (var j = 0, col; col = row.cells[j]; j++)
{
var imagePath = $jDecode(row.cells[0]).find('img:first').attr('src');
if(imagePath == "../icon_active1.gif")
{
arrType.push("active");
}
else if(imagePath == "../icon_deleted1.gif")
{
arrType.push("deleted");
}
else
{
arrType.push("active");
}
var featureValue = $jDecode(row.cells[1]).text();
arrType.push(featureValue);
arrType.push("Interior");
interiorValues.push(arrType);
}
}
alert(interiorValues[5][0]);
}
存储数据的 HTML 表
<TABLE id="dlInteriors" Width="300" Runat="server" CellSpacing="0" CellPadding="0">
<TR>
<TD id="interiortd" vAlign="top" width="350" runat="server"></TD>
</TR>
</TABLE>
行是在页面加载时动态添加的。
请指导我如何继续进行。