日期:2014-05-18  浏览次数:20453 次

用什么方式保存 javascript 对页面造成的修改吗?
如   页面加载后,通过javacript产生了一个表格数据,之后触发了服务器控件,使页面回滚了,我想保留原来的那个javascript产生的表格,不希望这个表格再次重新被javascript产生,有什么好方法吗?

------解决方案--------------------
将表格存在hidden中,hidden.value可保存为XML

服务端根据hidden.value.Length来判断
------解决方案--------------------
这样好像只有放在 hidden的input了

因为你要触发服务器端事件 刷新页面 所以没办法保存在内存中 只有提交到服务器 然后重新输出了
------解决方案--------------------
of cource not, because web is based on the http protocol, which is stateless.
you can store the data in hidden input control.
if you wanna simplify the solotion, you can just use ViewState. But be careful, for it will lessen your system performance.
------解决方案--------------------
用hidden保存