Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i set my web app up to use the global.asax file

Status
Not open for further replies.

mit99mh

Programmer
Sep 24, 2002
246
GB
i've set the root folder as an application folder and i've
set the Global.asax to use a code behind file

<%@ Application Codebehind=&quot;Global.asax.vb&quot; %>


In the Global.asax.vb file i set a variable in the method

Sub Application_Start(Sender As Object, E As EventArgs)
Application(&quot;Test&quot;) = &quot;Global.asax starting&quot;
End Sub

and then try and output this in a code behind page

lblMessage.Text = &quot; started &quot; & Application(&quot;Test&quot;) & &quot; here&quot;

But the Application(&quot;Test&quot;) bit is not shown. Any help much appreciated





 
Hi
You need
<%@ Application Codebehind=&quot;Global.asax.vb&quot; Inherits=&quot;MyProjectName.Global&quot; %>

as the global.asax file and this as the bones of your global.asax.vb file

Imports System.Web
Imports System.Web.SessionState

Public Class Global
Inherits System.Web.HttpApplication
...
End Class

Well this is how VS.net sets it up for me in any case

Mark Mark [openup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top