HTML Table回到其初始阶段 [英] HTML Table gets back to its initial stage

查看:49
本文介绍了HTML Table回到其初始阶段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html表,我在运行时填充表,即我在运行时添加行.现在,当我单击asp控件的保存按钮时,页面将刷新,并且表返回到其初始阶段,即它变为空.
谁能帮我这个忙,我不希望表格回到初始状态,我希望它在保存操作期间显示.请帮忙.

I have a html table, and i am filling the table at runtime, i.e i am adding the rows at runtime. now when i click the save button which is an asp control, the page gets refreshed and the table returns to its initial stage, i.e it becomes empty.
can anyone help me with this, i don''t want the table to go back to its initial stage, i want it to be displayed during save operation. please help.

推荐答案

如果您不需要完整的回发/整页重新呈现(将表还原到以前的状态),则需要使用其他技术来保存数据,例如 XMLHttpRequest .

保持UI完整,传递值以通过Javascript保存并保存在服务器上.
If you don''t need a complete postback/full page re-rendering (which is restoring the table to previous state), then you need to use some other technique to save data like XMLHttpRequest.

Keep the UI, intact, pass on the values to save via Javascript and save on server.


将表的加载功能放在页面加载时.
我认为这可以解决问题.
put the loading function of the table on page load.
I think this will solve the problem.


您应该调用在页面加载事件中动态创建HTML表的函数.现在,您填写表格并按按钮保存.但该按钮会导致帖子回发.加载后备页面时,它处于加载时的初始状态.因此将函数放在页面加载中.我认为应该可以解决问题.
you should call the function in which the HTML table is dynamically created on page load event. at the moment you fill the table and press the button to save . but the button causes the post back. when the post backed page is loaded it is in the initial condition when it was loaded. so place the function in Page Load. i think it should do the trick.


这篇关于HTML Table回到其初始阶段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆