c# - triggering label to appear after firing 4 buttons onclick events -


i have algorithm don't know if correct way. mentioned, label appear after user clicks on 4 different buttons, each button auto post back.

if(button 1 click && button 2 click && button 3 click && button 4 click) label1.visible = true; 

what should codes inside if statement?

you can use viewstate this. on each button click event update view state button flag. example button 1

if(viewstate["mybuttonstate"]==null)     viewstate["mybuttonstate"]=1; else     viewstate["mybuttonstate"]=((int)viewstate["mybuttonstate"]) | 1; 

you can use flag enumeration better approach. button 1-4 use 1,2,4,8 , in if statement

if(((int)viewstate["mybuttonstate"])==0x0000000f)     label1.visible=true; 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -