我的下拉列表值不会进入我的文本框 [英] my drop downlist value not loade into my text box

查看:97
本文介绍了我的下拉列表值不会进入我的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将下拉列表值发布到文本框中我使用sqlsource绑定下拉列表项目我在使用sql源进行第三次绑定后执行三向选择我想在文本框中显示值但是选择事件未触发将下拉列表值发布到文本框的代码是



i want to post my drop down list value into the text box i binded the dropdownlist items using the sqlsource i am performing a three way selection after the third binding using sql source i want to show the value in the text box but the selection event is not firing the code for posting drop downlist value to the text box is

protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtUrl.Text = DropDownList3.SelectedValue;
            
        }



i尝试以其他方式也像




i tried in the other way also like

protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
        {
           
            txtUrl.Text = DropDownList3.SelectedItem.Value;
            
        }

推荐答案

试试这个

DropDownList3 Autopostback = true

如果不起作用发送源
Try this
DropDownList3 Autopostback = true
if it does not work send the source






请在AutoPostBack Property True下拉列表。但是您的下拉列表绑定代码在PageLoad事件中出现在IsPostBack == false中。



谢谢
Hi,

Please on the AutoPostBack Property True for dropdownlist. But Your dropdownlist Binding code come in IsPostBack==false on PageLoad event.

Thanks


试一试,(我可能错了)

Give it a try, (I might be wrong)
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
        {
            if(!IsPostBack)
                txtUrl.Text = DropDownList3.SelectedValue;
            
        }



-KR


-KR


这篇关于我的下拉列表值不会进入我的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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