网站标题中的数据稳定性 [英] Data stability in a website's header

查看:91
本文介绍了网站标题中的数据稳定性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的网站标题中有一些控件(下拉列表和文本框),并且已将这些控件放在母版页中,因为我希望它们在所有页面中都可见.问题是,当用户更改页面时,控件数据会刷新,而我会丢失用户已选择的数据.我希望当用户更改网页时,数据(例如,组合框的选定索引和文本框中的数据)稳定且不依赖于用户正在处理的页面.
在此先多谢!

Hi,
I have some controls (dropdownlists and textboxs) in my website''s header and I have put that controls in my master page because I want them to be visible in all pages. The problem is that when a user changes the page, the controls data refreshes and I loose the data that have been selected by the user. I want that when a user changes a web page, the data (for example the selected index of comboboxes and data in textboxes) be stable and not dependant to the page that user is working on.
Thanks a lot in advance!
Good Luck!

推荐答案

发布到新页面之前,您可以在会话中存储下拉列表的选定值和文本框的文本.在新页面的页面加载时,从会话中读取值,然后将值设置回控件.在将值存储到会话时,您可以检查是否已经存在相同的值,请不要覆盖该值.
Before posting to a new page you can store the selected values of the dropdown and text of the text box in session. At the time of page load of new page read the values from session and set the values back to the control. At the time of storing the values to the session you can check that if the same value already exist then don''t overwrite the value.


这篇关于网站标题中的数据稳定性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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