我的母版页中有三个下拉列表,当页面被重定向时,下拉列表中的所选项目变为空。所选项目不应更改
问题描述:
我的母版页中有三个下拉列表,当页面被重定向时,下拉列表中的所选项目变为空。所选项目不应该更改
I have three dropdownlists in my master page, when the page is redirected selected item in dropdownlists are becoming empty.So the selected items are should not be change
答
将选定的索引或选定的DropDrownList值存储在会话对象中。
在页面的OnLoad事件中使用此会话对象值并设置下拉列表的选定索引。
检查出来:
http://forums.asp.net/t/1375391.aspx?Dropdownlist+on+主页+丢失+其+状态+后+后回复 [ ^ ]
希望这会有所帮助!!
问候,
Praneet
Hi,
Store the selected index or selected value of the DropDrownList in a session object.
In the OnLoad event of the page use this session object value and set the selected index of the drop down.
Check this out:
http://forums.asp.net/t/1375391.aspx?Dropdownlist+on+masterpage+loses+its+state+after+postback[^]
Hope this helps !!
Regards,
Praneet