Author: AndyMoireASP | Posted on: 1/17/2010 8:26:14 AM | Views : 381

Hi
I know this is a really minor problem, but I am getting myself into a tangle with it.
I have a button on my gridview that makes visible another gridview nested inside a column. What I want to do is to use the same button to hide it again. I can already make visible my nested gridview, and I know to hide the gridview itself would be the same code again. The problem I have is setting my flag in order to control which branch of my if statement is executed.
I tried writing this inside the button event bool flag = false; and then changed it to ture after the gridview is shown, but of course it re sets itself to false again, and the else bit is never reach when you press the button again.
Is there away where I can persist a flag that when the button is pressed one branch of the if statement is reached, and when it is pressed again, the next branch is run?
I do want to use JavaScript because the page is already overloaded ...

Go to the complete details ...