Click here to Skip to main content
15,911,360 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionproblem with GridView derived control selected items state maintainance set/reset Pin
VenkataRamana.Gali21-Jul-09 0:44
VenkataRamana.Gali21-Jul-09 0:44 
AnswerRe: problem with GridView derived control selected items state maintainance set/reset Pin
r a m e s h21-Jul-09 1:15
r a m e s h21-Jul-09 1:15 
AnswerRe: problem with GridView derived control selected items state maintainance set/reset Pin
Zafar A khan 21-Jul-09 1:44
professionalZafar A khan 21-Jul-09 1:44 
Questionhow to increment Application Object in Global.asax file Pin
QuickDeveloper21-Jul-09 0:17
QuickDeveloper21-Jul-09 0:17 
AnswerRe: how to increment Application Object in Global.asax file Pin
Paddy Boyd21-Jul-09 0:18
Paddy Boyd21-Jul-09 0:18 
GeneralRe: how to increment Application Object in Global.asax file Pin
QuickDeveloper21-Jul-09 0:21
QuickDeveloper21-Jul-09 0:21 
GeneralRe: how to increment Application Object in Global.asax file Pin
Paddy Boyd21-Jul-09 0:23
Paddy Boyd21-Jul-09 0:23 
AnswerRe: how to increment Application Object in Global.asax file Pin
Abhijit Jana21-Jul-09 1:27
professionalAbhijit Jana21-Jul-09 1:27 
QuickDeveloper wrote:
1. protected void Session_Start(object sender, EventArgs e)
2. {
3. int userCount=(int)(Application["userCount"]) ;
4. Application["userCount"] = ++userCount;
5. }


It is always better to use Application.Lock() and Application.Unlock() before any kind of operation with Application Variable. Because ASP.NET is multithreaded and when multiple users accessing the web site at the same it is required to synchronized the data
void Session_Start(object sender, EventArgs e) 
 {
     if (Application["userCount"] != null) {
         Application.Lock();
         int visitorCount = (int)Application["userCount"];
         Application["userCount"] = userCount++;
         Application.UnLock();
     }
 }


cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
My Latest Article : IIS Remote Debugging

AnswerRe: how to increment Application Object in Global.asax file Pin
Abhishek Sur21-Jul-09 2:52
professionalAbhishek Sur21-Jul-09 2:52 
GeneralRe: how to increment Application Object in Global.asax file Pin
QuickDeveloper21-Jul-09 19:45
QuickDeveloper21-Jul-09 19:45 
QuestionIssue with HttpWebResponse Pin
dews turner21-Jul-09 0:13
dews turner21-Jul-09 0:13 
AnswerRe: Issue with HttpWebResponse Pin
N a v a n e e t h21-Jul-09 0:22
N a v a n e e t h21-Jul-09 0:22 
GeneralRe: Issue with HttpWebResponse Pin
dews turner21-Jul-09 1:48
dews turner21-Jul-09 1:48 
QuestionCrystal Report Binding To the Own Created DataSet Pin
HatakeKaKaShi21-Jul-09 0:13
HatakeKaKaShi21-Jul-09 0:13 
QuestionHow do i play audio stored in Database on my asp.net webpage Pin
DotNetCoderJunior20-Jul-09 23:51
DotNetCoderJunior20-Jul-09 23:51 
AnswerRe: How do i play audio stored in Database on my asp.net webpage Pin
Manas Bhardwaj20-Jul-09 23:58
professionalManas Bhardwaj20-Jul-09 23:58 
Questionmail from asp.net1.1 Pin
Kissy1620-Jul-09 23:47
Kissy1620-Jul-09 23:47 
AnswerRe: mail from asp.net1.1 Pin
Christian Graus20-Jul-09 23:50
protectorChristian Graus20-Jul-09 23:50 
GeneralRe: mail from asp.net1.1 Pin
Kissy1621-Jul-09 0:15
Kissy1621-Jul-09 0:15 
GeneralRe: mail from asp.net1.1 Pin
Manas Bhardwaj21-Jul-09 0:28
professionalManas Bhardwaj21-Jul-09 0:28 
AnswerRe: mail from asp.net1.1 Pin
Manas Bhardwaj21-Jul-09 0:04
professionalManas Bhardwaj21-Jul-09 0:04 
GeneralRe: mail from asp.net1.1 Pin
Kissy1621-Jul-09 0:16
Kissy1621-Jul-09 0:16 
GeneralRe: mail from asp.net1.1 Pin
Christian Graus21-Jul-09 10:18
protectorChristian Graus21-Jul-09 10:18 
QuestionInterview Questions Pin
siddisagar20-Jul-09 22:59
siddisagar20-Jul-09 22:59 
AnswerRe: Interview Questions Pin
Christian Graus20-Jul-09 23:03
protectorChristian Graus20-Jul-09 23:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.