Application Variable and Cookie Container

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know if you can store a Net.CookieContainer object in an
Application variable?
 
An Object is an Object ( Until proven wrong) You can store any object in an
Application Variable
 
Thank you for your assistance. That is what I thought.

But see the error message below when I try to init an application variable
as a cookiecontainer in global.asax.



Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct
format.

Source Error:


Line 5:
Line 6: Sub Application_Start(ByVal sender As Object, ByVal e As
EventArgs)
Line 7: Dim Application("partsbase_cookiecontainter") As
Net.CookieContainer
Line 8: End Sub
 
Paul that is wrong.

dim objectContainer as new cookieContainer() ' blah blah blah
Application.Add("partsbase_cookiecontainter", objectContainer)
 
Thank you. This resolved the error.

LVP said:
Paul that is wrong.

dim objectContainer as new cookieContainer() ' blah blah blah
Application.Add("partsbase_cookiecontainter", objectContainer)
 
Back
Top