dropdownlist上的错误(当edit_profile_page加载时,那个时间数据完全填满但更新时显示错误) [英] error on dropdownlist (when edit_profile_page loads then that time data completly filled but on update shows error)

查看:72
本文介绍了dropdownlist上的错误(当edit_profile_page加载时,那个时间数据完全填满但更新时显示错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i下拉列表中有错误

当我运行edit_profile_page页面时

然后那个时候它成功加载然后那个时间数据也完全填满了成功..

但是当我更改下拉列表值并点击更新按钮时它显示错误。





i have an error on dropdownlist
when i run the page of edit_profile_page
then that time it loads successfully and then that time data also completly filled successfully..
but when i changed the dropdownlist value and click on updatebutton it shows error.

'cmbprofilefor' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value





cmbprofilefor是我的下拉列表名称



i使用这行代码存储在数据库中的所选项目





"cmbprofilefor" is my dropdownlist name

i used this line of code for selected item which is stored in database

cmbprofilefor.SelectedValue = dt.Rows[0]["ProfileFor"].ToString().Trim();





此代码成功运行并在下拉列表中选择显示值,该值存储在数据库中。

,但当我更改项目时,意味着当我从下拉列表中选择项目时更改)并单击保存按钮,那时它会显示错误。



其中是我的错误??



this code is successfully work and display value selected in dropdownlist which stored in database.
but when i change the items means when i selected item changed from dropdownlist) and click on save button that time it shows me error.

where is the my mistake ??

推荐答案

错误应该是明确的。您正在尝试将值设置为下拉列表的数据源中不存在的值。您需要对其进行调试以找出原因。
The error should be clear. You are trying to set a value to be something that does not exist in the datasource for the drop down. You'll need to debug it to find out why that is.


这篇关于dropdownlist上的错误(当edit_profile_page加载时,那个时间数据完全填满但更新时显示错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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