如何在浏览器后退按钮上保持下拉值? [英] how to maintain dropdown value on browser back button?

查看:71
本文介绍了如何在浏览器后退按钮上保持下拉值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在浏览器后退按钮单击时保持下拉列表的值。我的下拉列表中有五个修复项目,我没有通过代码绑定它。只需在aspx的源文件中添加列表项。现在,当用户转到下一页并单击浏览器后退按钮时,我想保持上次选择的下拉列表的值?

how can i maintain the value of dropdownlist on browser back button click. i have five fix items on my dropdown and i did not bind it via code. just add list items on the source file of aspx. now when user go to next page and click browser back button i want to maintain the value of the dropdown which was last selected ?

推荐答案

后退按钮单击浏览器页面从缓存加载,而不是从服务器加载。

使用会话在dropdownlist中存储选定的项目,会话值在asp.net页面上可用。
The back button click of browser page is loaded from the cache and not from the server.
Use session to store selected item in dropdownlist, session values is available across asp.net pages.


这篇关于如何在浏览器后退按钮上保持下拉值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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