|
|
 |
RE: FN-FORUM: .NET Global.asax
date posted 24th November 2005 11:31
Eureka!
Thanks for the help on the journey, I've now arrived.
The solution to my problem was to take the comparison of the
ServerVariables("SERVER_NAME"), which determined the DB Connection string,
out of the "Session Start" sub and put it in the "Application Start" sub. I
now have a perfectly formed DB Connection string in my Web Service and no
designer code:)
Thanks to Dawn and Andy:)
Regards,
Craig
(Now for the next battle, lol)
-----Original Message-----
Hi, You do need to have;
Imports System.Web
Imports System.Web.SessionState
Public Class Global
Inherits System.Web.HttpApplication
#Region " Component Designer Generated Code "
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
Private Sub
InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
#End Region
End Class
If you don't have the Imports and Initializing then you'll be a bit
stuffed
And as Dawn's said, there's almost little point in writing all your code
in "classic ASP" style in the aspx page if you're using .NET. The whole
point of it is to be able to write "proper" code in code-behind.
Cheers
Andy
|
 |
|