Sunday, 24 February 2013

Maintaining state for logged Users

  1.    Application.Lock();  
  2.           
  3.         int clickCounter = 0;  
  4.         if(Application["ClickCounter"] !=null)  
  5.         {  
  6.             clickCounter = (int)Application["ClickCounter"];  
  7.         }  
  8.         clickCounter++;  
  9.         Application["ClickCounter"] = clickCounter;  
  10.         Application.UnLock();  
  11.   
  12.         Label1.Text = "Button Clicked: " + clickCounter.ToString() + " times";

No comments:

Post a Comment

Extracting Nupkg files using command line

Rename it to zip first then extract files as below 1.     Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2.     Make sure to repla...