相关的下拉菜单项应显示在文本框中 [英] Related Dropdown item should be displayed to textbox

查看:111
本文介绍了相关的下拉菜单项应显示在文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在一个页面中,我们有4列,数据存储在数据库中

我们有1个下拉框和3个文本框
当我们从下拉框中选择一个项目时,该项目的相关详细信息应显示在文本框中

对于例如
当我们选择应在相关文本框中显示人员详细信息(电话号码,地址,年龄)的名称时,下拉列表中就会有名称.
谁能说出如何在asp

Hi
in an page we are having 4 columns and the data''s are stored in the database

we have 1 dropdownbox and 3textbox
when we select an item from dropdown box the related detail for the item should be displayed in the textbox

for eg
we have names in dropdown when we select the name that persons details (phoneno,address,age) should be displayed in the related textbox
can any one say how to write a program for this in asp

推荐答案

1中为此编写程序.使组合框的自动回传属性正确.
2.写入SelectedIndex更改事件.
1. Make Autopostback proprty of combobox true.
2. Write in SelectedIndex changed event.
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        //Use DropDownList1.SelectedItem.ToString() to Get selected Text
        //Use DropDownList1.SelectedValue.ToString() to Get selected value

        //Execute query to fetch detail of seleted item
        //Set result to different textboxes
    
}


幸福的编码:laugh:;)

如果对您有用,请标记为 答案/解决方案 .


HAPPY CODING :laugh: ;)

Mark As Answer/Solution if it is useful to you..


这篇关于相关的下拉菜单项应显示在文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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