B
Blue Man
Hello
I want to create a link that open and close a panel. but i can't save a
variable as a flag to test each time if the panel is open or not, this is my
code :
int flag=0;
private void LinkButton1_Click(object sender, System.EventArgs e)
{
if(flag==0)
{ Panel1.Visible=true;
Panel1.Enabled=true;
flag=0; }
else{
Panel1.Visible=false;
Panel1.Enabled=false;
flag=1;
}}
the problem is Flag varibale that when ever i push the link the page reload
so the value resets to 0 again. how can i use global variables that don't
change whit refreshing page?
i know i can use database but that's not the way to solve on such a simple
page. i also tried Session but it has the same problem, resets whenever
page refresh(or link gets click).
Thanks
I want to create a link that open and close a panel. but i can't save a
variable as a flag to test each time if the panel is open or not, this is my
code :
int flag=0;
private void LinkButton1_Click(object sender, System.EventArgs e)
{
if(flag==0)
{ Panel1.Visible=true;
Panel1.Enabled=true;
flag=0; }
else{
Panel1.Visible=false;
Panel1.Enabled=false;
flag=1;
}}
the problem is Flag varibale that when ever i push the link the page reload
so the value resets to 0 again. how can i use global variables that don't
change whit refreshing page?
i know i can use database but that's not the way to solve on such a simple
page. i also tried Session but it has the same problem, resets whenever
page refresh(or link gets click).
Thanks