MarcGraff
asked on
Rerun Application_Start?
How would one programmatically rerun Application_Start?
Thanks!
- Marc
Thanks!
- Marc
ASKER
Good Morning AGBrown,
My objective is to reload the "Application" variables. I have tryed to create a seporate class but each time it has failed.
My closest attempt:
Public Sub ReloadVars(ByVal oGlobal As System.Web.HttpApplication )
oGlobal.Application.Add("T estName", "TestValue")
End Sub
but I do not know what to pass into this from the "reset" page.
Thanks!
- Marc
My objective is to reload the "Application" variables. I have tryed to create a seporate class but each time it has failed.
My closest attempt:
Public Sub ReloadVars(ByVal oGlobal As System.Web.HttpApplication
oGlobal.Application.Add("T
End Sub
but I do not know what to pass into this from the "reset" page.
Thanks!
- Marc
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good day AGBrown,
I am working with the code below but it does not retain the Application variables in the global or page context. Any other suggestions?
In Global.asax.vb:
Public Sub AppReset(ByVal bClearRecSets As Boolean, ByVal bDisplay As Boolean)
Dim oApp As New App_Reset
oApp.ReloadVars(bClearRecS ets, bDisplay)
End Sub
In ReloadVars:
Public Class App_Reset
Public Sub ReloadVars(ByVal bClearRecSets As Boolean, ByVal bDisplay As Boolean)
HttpContext.Current.Applic ation.Add( "Test", "TestValue")
End Sub
End Class
On ResetPage:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim APP_Vars As New App_Reset
APP_Vars.ReloadVars(False, False)
End Sub
I am working with the code below but it does not retain the Application variables in the global or page context. Any other suggestions?
In Global.asax.vb:
Public Sub AppReset(ByVal bClearRecSets As Boolean, ByVal bDisplay As Boolean)
Dim oApp As New App_Reset
oApp.ReloadVars(bClearRecS
End Sub
In ReloadVars:
Public Class App_Reset
Public Sub ReloadVars(ByVal bClearRecSets As Boolean, ByVal bDisplay As Boolean)
HttpContext.Current.Applic
End Sub
End Class
On ResetPage:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim APP_Vars As New App_Reset
APP_Vars.ReloadVars(False,
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much Andy for all of your help! And sorry it took me so long to get this up and running!
No problem, glad you solved it.
Andy
Andy
But, there is a better solution in terms of "code design" anyway; this would be to extract your code into a seperate class, and then call that class's methods from Application_Start and any other place you want it called.
Andy