www.evidhyashala.com provides free free mock test , free online exam , online exam free test series , online exam free , Online Test Exam Series , free exam papers past papers , online exam form ,Online Test Series for Exam Prep. Free Mock Tests - for All govt jobs. Bank PO, Clerk, SSC CGL, CHSL, JE, GATE, Insurance, Railways, IBPS RRB, SBI, RBI, IPPB, BSNL TTA

Sponser Link

know more info pls click here

Give an example of how to use Application and Session events?-interview04032012

To see how Application and Session events occur, add the following code to the Global.asax file in a Web forms project. void Application_Start(object sender, EventArgs e) { // Create Application state variables. Application["AppCount"] = 0; Application["SessCount"] = 0; // Record application start. Application["AppCount"] = (int)Application["AppCount"] + 1; } void Session_Start(object sender, EventArgs e) { // Count sessions. Application["SessCount"] = (int)Application["SessCount"] + 1; } void Session_End(object sender, EventArgs e) { // Decrement sessions. Application["SessCount"] = (int)Application["SessCount"] - 1; } Add the following code to WebForm1.aspx file in a Web forms project and set WebForm1 as start up page. protected void Page_Load(object sender, EventArgs e) { // Display Application count. Response.Write("Number of applications: " + Application["AppCount"] + " "); // Display session count. Response.Write("Number of sessions: " + Application["SessCount"] + " "); } To demonstrate the events, run the preceding code, and then start a new instance of the browser and navigate to the address. Each new instance of the browser increments the session count, but the application count stays at 1.

0 comments:

Popular Posts