无法获取文本框中的复选框列表的选定值 [英] not able to get selected values of checkboxlist in textbox

查看:75
本文介绍了无法获取文本框中的复选框列表的选定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了带有弹出控件扩展器的文本框和带有复选框列表的面板
每当我单击复选框时,值都存储在表中,但我无法在文本框中查看该值
代码如下:

i have used a textbox with a popup control extender and a panel with a checkboxlist
when ever i click on the checkbox the values are stored in table but i can''t view that values on my textbox
code as follows:

<asp:TextBox ID="txtCombo" runat="server" ReadOnly="true" >  
           <cc1:PopupControlExtender ID="PopupControlExtender1"  runat="server" 

               TargetControlID="txtCombo" Position="Bottom" 

           PopupControlID="panel3" >


我的带有复选框的面板如下:


and my panel with checkbox is as follows:

<asp:Panel ID="panel3"  runat="server" ScrollBars="Vertical" BorderWidth="1" Width="140"  BackColor="AliceBlue"  BorderColor="Azure">
    <asp:CheckBoxList ID="chkList" runat="server"  CssClass="style6" Width="124" Height="15"  OnSelectedIndexChanged="chkList_SelectedIndexChanged" >
    <asp:ListItem>1
    <asp:ListItem>2
    <asp:ListItem>3
    <asp:ListItem>4
    <asp:ListItem>5
    <asp:ListItem>6
    <asp:ListItem>7


请帮助我,我的错误到底在哪里?


Kindly help me out where is my error exactly

推荐答案

您的html看起来没有书写,因此请查看此 ^ ]
Your html doesn''t look write so have a look at this W3 Schools Checkboxlist Demo[^]


可能我没有按复选框列表正确粘贴,但其余部分保持不变
请帮我找出为什么将我的复选框列表添加到表中,但选择内容未显示在文本框中的问题
might i have not paste by checkboxlist properly but the rest is as it is
kindly help me out why the list of my checkbox is added to the table but the selection is not display on the textbox


该表的控件ID必须是chkList

your controlID for the table needs to be the chkList

<asp:TextBox ID="txtCombo" runat="server" ReadOnly="true" ControlID="chkList" >
           <cc1:PopupControlExtender ID="PopupControlExtender1"  runat="server"

               TargetControlID="txtBox" Position="Bottom"

           PopupControlID="panel3" >



文本框需要通过检查表的选定值进行控制

我希望这会有所帮助,并且我已经正确解释了这个问题



the textbox needs to be controlled by the selected value of the checklist

i hope this helps and i have interpreted the question correctly


这篇关于无法获取文本框中的复选框列表的选定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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