保存记录 [英] Saving a record

查看:79
本文介绍了保存记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个带有标签控件的页面.第一个选项卡在iframe中托管数据输入页面以创建记录,第二个选项卡具有一个iframe,该iframe显示带有gridview的页面,该页面显示所有已保存/创建的记录.

在第一个标签中的保存"按钮上,我为Onclick事件分配了一个javascript,因此它使第二个标签处于活动状态,而无需刷新整个页面.在此功能中,仅第二个选项卡的iframe再次被赋予src,在该位置,gridview页将加载并从数据库中获取最新记录.
它很快.带有选项卡控件的整个页面不会刷新.

但我也想先保存记录,然后再切换到第二个选项卡.但是我发现保存SAVE按钮是否需要服务器端保存,并且在完成保存第二个选项卡中的gridview页之前,它不显示最新创建的记录.

因此,如果带有选项卡控件的页面没有刷新,那么这里如何首先保存记录,然后通过JavaScript调用第二个选项卡? (我认为Ajaxpro不能在这里使用,因为它无法获得数据输入页面中的控件的值来保存记录.)

谢谢,

Vijay

Hi,

I have a page with tab control. The first tab hosts data entry page in an Iframe to create a record and second tab has an Iframe which shows the page with gridview which shows all the saved/created records.

On the SAVE button in the first tab, I have assigned a javascript on Onclick event so it makes second tab active without refreshing whole page. In this function only the second tab''s iframe is given src again where gridview page loads and brings the latest records from the database.
it very quick. The whole page with tab control doesn''t refresh.

But I also want to save the record first and then switch to second tab. But I find if SAVE buttons server side saving takes time and before it complete the gridview page in the second tab is loaded and it doesnt show the latest created record.

So here how to save the record first and then call second tab through a javascript provided the page with the tab control doesnt refresh? (I think Ajaxpro can not be used here as it wont get the hold of controls in the data entry page to have values to save the record.)

Thanks,

Vijay

推荐答案

基本上,您需要执行回发操作,该操作首先保存您的记录,然后使用更新的数据显示您的网格.或者,要使用AJAX做到这一点,您需要编写代码以捕获来自服务器的消息,然后导航到另一页.
Basically, you need to do a postback which first saves your record, THEN shows your grid with the updated data. Or, to do it with AJAX, you''d need to write code that catches the message back from the server and THEN navigates to the other page.


这篇关于保存记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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