如何在textchange事件上绑定checkboxlist [英] How to bind checkboxlist on textchange event

查看:54
本文介绍了如何在textchange事件上绑定checkboxlist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ontextchange事件无法显示填充复选框如果我们使用pageload或button_click事件而不是show filled checkboxlist items.and binxcheckbox函数也会在textchange事件触发时调用但在此之后我们点击任何按钮而不是显示复选框列表项后否则不显示



我尝试过:



i尝试调用button_click(null,null )事件通过textchange eventplz给我解决方案当文本框丢失焦点时直接fillcheckbox并在屏幕上显示我在基于网络的应用程序的asp.net中trid



code



private void BindSetList()

{



str =SELECT productnm ,来自Product_master的id;

ds = objgn.getSqlValue(str,Set_detail);

CheckBoxList1.DataSource = null;

CheckBoxList1 .DataSource = ds;

CheckBoxList1.DataTextField =productnm;

CheckBoxList1.DataValueField =id;



CheckBoxList1.DataBind();

btnnext_Click(null,null);



}

protected void txtProductnm_TextChanged(object sender,EventArgs e)

{

BindSetList() ;

}

ontextchange event cant show fill checkboxlist if we use pageload or button_click event than show filled checkboxlist items.and binxcheckbox function also call when textchange event fire but after that we click on any button than after show checkbox list item otherwise not show

What I have tried:

i tried to call button_click(null,null) event pass through textchange eventplz give me solution when on lost focus of textbox directly fillcheckbox and show on screen and i trid in asp.net on web based application

code

private void BindSetList()
{

str = "SELECT productnm,id from Product_master";
ds = objgn.getSqlValue(str, "Set_detail");
CheckBoxList1.DataSource = null;
CheckBoxList1.DataSource = ds;
CheckBoxList1.DataTextField = "productnm";
CheckBoxList1.DataValueField = "id";

CheckBoxList1.DataBind();
btnnext_Click(null, null);

}
protected void txtProductnm_TextChanged(object sender, EventArgs e)
{
BindSetList();
}

推荐答案

如果更新面板中的文本框和非更新面板中的复选框列表不能显示,

解决方案是获得任何相关的更改,而不是两个控件都在更新面板中
if textbox in update panel and checkboxlist in not update panel than cant show,
the solution is get any related change than both control is in update panel


这篇关于如何在textchange事件上绑定checkboxlist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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