1
Answer

Changing Text of CheckboxList Item

Sushant Torankar

Sushant Torankar

Jun 25
383
1

Hello,

Can i change Text of CheckboxList ListItem codebehind in asp.net

I have checkboxlist . for ex :

<asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatLayout="OrderedList" Width="432px">                 
                 <asp:ListItem Value="1">COBOL</asp:ListItem>  
                 <asp:ListItem Value="2">PERL</asp:ListItem>  
                <asp:ListItem Value="3">JAVA</asp:ListItem>  
</asp:CheckBoxList>

I am binding checkboxlist on dropdownlist selected index change event.
I want to change text PERL to PHP on one of dropdown selection, as I am using only one Checkboxlist on all dropdown selection, so i just want to change text of one of the listitem

Thanks ! 

Answers (1)
0
Riddhi Valecha

Riddhi Valecha

434 3.3k 426.4k Jun 25

Hello,

Use the property "SelectedMode" as "Single" of checkboxlist.

Set - Autopostback to true.

protected void checkboxlist_SelectedIndexChanged(object sender, EventArgs e)
    {
        Bind Dropdownlist
    }