Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

selected index changed C# question

Options
  • 21-10-2008 5:09pm
    #1
    Registered Users Posts: 6,521 ✭✭✭


    In a web form ive a drop down list for a hotel. So say I choose Daycare in the list ive on the form an option for how many adults but when daycare is chosen I want that to be not visible.

    How do i get this to happen?

    protected void ddlActivity_SelectedIndexChanged(object sender, EventArgs e)
    {
    if (ddlActivity.SelectedIndex = 1)
    {
    lblChildren.Enabled = false;
    }
    }

    thats what I have but its wrong


Comments

  • Closed Accounts Posts: 164 ✭✭ob


    To hide it?

    lblChildren.Visible= false;


  • Registered Users Posts: 6,521 ✭✭✭joe123


    sorry had enabled in there without thinking.

    Say i pick the 3rd option in my list "daycare" well I dont want my adult label showing. So how do I say ive daycare selected and so i want my lblAdult.visible=false

    the error says i cannot convert type string to bool


  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    == is the comparison operator = is assignment


Advertisement