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

Showing Answers 1 - 2 of 2 Answers

Praveen Kumar

  • Sep 23rd, 2005
 

To provide individual data for a user during a session, data can be stored with session scope. In the following sample, values for user preferences are initialized in the Session_Start event in the Global.asax file.Sub Session_Start() Session("BackColor") = "beige" ...End Sub'======================================================================In the following sample a file is read in Application_Start (defined in the Global.asax file) and the content is stored in a DataView object in the application state.Sub Application_Start() Dim ds As New DataSet() Dim fs As New FileStream(Server.MapPath("schemadata.xml"),FileMode.Open,FileAccess.Read) Dim reader As New StreamReader(fs) ds.ReadXml(reader) fs.Close() Dim view As New DataView (ds.Tables(0)) Application("Source") = viewEnd Sub

  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