文本框控件和下拉列表控件很清楚 [英] Textbox controls and Dropdown list controls are clear
本文介绍了文本框控件和下拉列表控件很清楚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hai,
在我的asp.net页面中,我绑定了所有文本框和下拉列表的值并启用了false。在按钮单击事件中,我只是为所有控件提供启用true的编码。但每当我点击该按钮时,所有控件都被清除。清除所有下拉列表值。为什么会这样?我正在使用手风琴面板。请帮帮我。
Hai,
In my asp.net page, I have Bind the values and enabled false to all the textboxes and dropdownlist. In the button click event I just give the coding for enabled true for all that controls. But Whenever i click that button all that controls are cleared. All the Dropdown list values are cleared. Why it is? I am using accordion panel. Please help me.
推荐答案
我的猜测是你没有测试
My guess would be that you are not testing
if (!IsPostBack)
{
}
所以当你点击按钮时你的值被清除。
so your values are being cleared when you click the button.
在PageLoad事件中写下像
$这样的短代码b $ b
In PageLoad event write the short code like
If(!IsPostBack)
{
//write your code here to bind dropdown and textbox
}
这篇关于文本框控件和下拉列表控件很清楚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文