如何保留列表框选中的值 [英] how to retain the listbox selected value

查看:66
本文介绍了如何保留列表框选中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我从列表框中选择了一个项目并移动到另一个页面。现在当我移回列表框页面时,我现在有列表框选择项目值如何显示列表框以前选择的值。

Hi I selected one item from the listbox and moved to another page.now Iam having the listbox selected item value now when I move back to the listbox page how can i show the listbox previous selected value.

推荐答案

将值保存在会话状态,然后在重新加载时将会话状态的值分配给列表框(加载列表框值后)。
Save the value in the session state, then upon reload assign the value from session state to the listbox (after loading the listbox values).


_Damian S_说的是对的。会话是跟踪所有页面中的值的最佳方式,但您也可以使用视图状态来维护值。
_Damian S_ said is correct. session is the best way for tracking values in all pages, but you can also use view state to maintain the values.


这篇关于如何保留列表框选中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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