Can you give an example of what might be best suited to place in the application_Start and Session_Start subroutines?

Showing Answers 1 - 7 of 7 Answers

samiksc

  • Jan 13th, 2006
 

Application_Start event should be used for initializing application-wide used variables and objects. For example if you want to find out number of connected users at any time you may initialize a variable user_count to 1 in Application_Start

Session_Start should be used to initialize session specific variables, for example user name (to be shown on each page after the user loggs in) and other user preferences.

  Was this answer useful?  Yes

Application_Start:----generally placed in global.asax page...

As the first user visits the start page of a  Web application, this event is occurred...
this event is used to initialize the objects and data tht a user want to make available to all current sessions of the visited web applications..



Session_Start:----generally placed in global.asax page...

For each user visiting the web application, it creartes a new instances of session variables used by the visitor.......

  Was this answer useful?  Yes

Amar

  • Jun 5th, 2007
 

The best location to write such type of methods is Global.ascx

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions