0

I have an increment and decrement button to all users to record against 4 different options (how many times this option has been done) So they choose the options from a drop down menu and then the panel appears that the two buttons are sitting within. It starts with the text for the count starting at "None" when it increments it goes up to 1, 2 so on. When it decrements its goes 2, 1, 0, -1 etc instead of "None", the way the code is suppsoed to work is if the count for that option is 0 then the decrement button doesn't appear.

This is the if statement I was using

 if (ddlAdvertType.SelectedValue != "0")
                {
                    pnlOccurrances.Visible = true;


                    if (lblAdvertOccurrances.Text == "None")
                    {
                        imgBtnDecrementOccur.Visible = false;
                    }
                    else
                    {
                        imgBtnDecrementOccur.Visible = true;
                    }
                }

                else
                {
                    pnlOccurrances.Visible = false;
                }

So it isn't working properly, any ideas?

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by coder91
0

I got it figured out. Created another method that checked the count to display the button.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.