下拉列表没有回发 [英] Dropdownlist No Postback

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

问题描述





如何让dropdownlist没有回发 - 我有一个下拉列表,我将代码放入选定的indexchanged-基本上为每个indexchanged连接代码将连接到sql并获取值然后用值填充文本框。



这里是我的代码





How can I make dropdownlist no postback - I have a dropdownlist which I put a code in selected indexchanged -basically for every indexchanged the code will connect to sql and get values then populate textboxes with values.

here is my code

<asp:DropDownList ID="ddlSalesOrg" runat="server" Style="width: 200px;" AutoPostBack="true" />





显然,当我删除autopostback =true时 - 则indexchanged将无法按预期运行。希望你能得到我的问题。



谢谢..



Obviously when I remove the autopostback="true" - then indexchanged will not function as expected. Hope you get my question.

thanks..

推荐答案





如果你想在下拉列表中显示选择ndex已更改事件
Hi,

You Must give auto post back true if u wants to display in dropdown list select ndex changed event


OnSelectedIndexChanged 事件,你必须给自动回复真仅当您提供 AutoPostBack =true时才能工作。



当用户在TextBox中按ENTER或TAB时,AutoPostBack属性用于设置或返回是否发生自动回发控制。



如果此属性设置为TRUE,则启用自动回发,否则为FALSE。默认值为FALSE。




首先,你必须了解基本的东西。请查看以下文章。



http://www.dotnetspider.com/resources/189-AutoPostBack-What-How-works.aspx [ ^ ]
OnSelectedIndexChanged event will work only if you give AutoPostBack="true".

The AutoPostBack property is used to set or return whether or not an automatic post back occurs when the user presses "ENTER" or "TAB" in the TextBox control.

If this property is set to TRUE the automatic post back is enabled, otherwise FALSE. Default is FALSE.


First you have to understand the basic thing. Check the below article.

http://www.dotnetspider.com/resources/189-AutoPostBack-What-How-works.aspx[^]


对于混乱感到抱歉 - 我想说的是 - 我想要触发我的indexchanged事件而不回发..希望我现在听起来很清楚..谢谢......
Sorry for the confusion - what im trying to say is - I want to trigger my indexchanged event without postback.. hope i sound clearly now..thanks...


这篇关于下拉列表没有回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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