我的母版页中有三个下拉列表,当页面被重定向时,下拉列表中的所选项目变为空。所选项目不应更改 [英] 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

查看:59
本文介绍了我的母版页中有三个下拉列表,当页面被重定向时,下拉列表中的所选项目变为空。所选项目不应更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的母版页中有三个下拉列表,当页面被重定向时,下拉列表中的所选项目变为空。所选项目不应该更改

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


这篇关于我的母版页中有三个下拉列表,当页面被重定向时,下拉列表中的所选项目变为空。所选项目不应更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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