Click here to Skip to main content
15,912,457 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
asp.net code
XML
<div class="row">
                          <cc1:HoverMenuExtender ID="HoverMenuExtender1" runat="server" TargetControlID="MultiSelectDDL"  PopupControlID="PanelPopUp" >

                          </cc1:HoverMenuExtender>
                           <asp:DropDownList ID="MultiSelectDDL" TabIndex="0" Class="for-control"
                               runat="server"
                               onselectedindexchanged="MultiSelectDDL_SelectedIndexChanged1">
                               <asp:ListItem Value="all">Select Language for Question</asp:ListItem>
                           </asp:DropDownList>

                           <asp:Panel ID="PanelPopUp" CssClass="popupMenu" runat="server">
                               <asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="true"
                                   onselectedindexchanged="CheckBoxList1_SelectedIndexChanged">
                                   <asp:ListItem Value="l1">Marathi</asp:ListItem>
                                   <asp:ListItem Value="l2">Hindi</asp:ListItem>
                                   <asp:ListItem Value="l3">English </asp:ListItem>
                               </asp:CheckBoxList>
                           </asp:Panel>
                       </div>



C# code
C#
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
    for (var i = 0; i < 3; i++)
    {
        if (CheckBoxList1.SelectedIndex == 0)
        {

            Panelmarathi.Visible = true;
        }
        else if (CheckBoxList1.SelectedIndex == 0 && CheckBoxList1.SelectedIndex == i)
        {
            Panelmarathi.Visible = true;
            Panelhindi.Visible = true;
        }
        else if (CheckBoxList1.SelectedIndex == 0 && CheckBoxList1.SelectedIndex == i)
        {
            Panelmarathi.Visible = true;
            Panelenglish.Visible = true;
        }
    }
Posted
Updated 23-Oct-15 0:12am
v2
Comments
OriginalGriff 23-Oct-15 5:46am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So what is it doing that you didn't expect, or not doing that you did?
Use the "Improve question" widget to edit your question and provide better information.
George Jonsson 23-Oct-15 5:47am    
So what is your problem?
Do you want someone to rewrite your code for you???
Design5ud 23-Oct-15 6:16am    
i tried some other ways but i am not geeting what i want to display , according to check box selection i want to display panels.
Krunal Rohit 23-Oct-15 6:18am    
Not a question.

-KR
Design5ud 23-Oct-15 6:33am    
i don't understand what you want to say, but my question is this ,
I want to display and hide Panels According to the selection of the checkbox list?

1 solution

Um.
Look at your code.
I'll compress it a bit...
C#
if (A) { ... }
else if (A && B) { ... }
else if (A && B) { ... }

So...if it's not A, what does it do? Nothing...

And even if it did have something like the right conditions (and I'm not sure what they are) the conditionally executed code only makes things visible, it doesn't try to hide anything. So nothing will ever disappear either.
 
Share this answer
 
Comments
Design5ud 23-Oct-15 6:45am    
Thanks man...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900