在asp.net中下拉绑定 [英] drop down binding in asp.net

查看:72
本文介绍了在asp.net中下拉绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,其中我必须在文本框中显示用户的所有数据,以便他可以对其进行编辑.我也有一些下拉控件.我正在使用实体框架.我有一个名称为binddata的公共fn( )我在page_load事件中调用的
当我绑定数据时

I have a page in which i have to display all the data of user in textboxes so that he can edit it.i have some drop down controls too.i am using entity framework.i have a public fn of name binddata()which i call on page_load event
as i bind data

txtAddress2.Text = _tblzeumay.Tbl_Member.Tbl_Member_Address.address2;
 drpCountry.text= _tblzeumay.Tbl_Member.Tbl_Member_Address.Tbl_Country.country_name;


此代码在文本框中显示了正确的数据,但下拉列表为空.


this code is showing correct data in textbox but dropdown is empty.

推荐答案

您好,
您将需要绑定下拉列表,而不是设置其文本.
参见以下链接:
entity-framework- --fetching-and-population-the-data-in-the-dropdown.aspx [ ^ ]
Hi,
You will need bind the dropdown instead setting its text.
See below link:
entity-framework---fetching-and-populating-the-data-in-the-dropdown.aspx[^]


这篇关于在asp.net中下拉绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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