There are a couple methods available to you.
[a] You can create a class with public constances
Public Class Globals
Public Const NumberOfRecords As Integer = 15
...
...
End Class
And access them via Globals.NumberOfRecords
[b] You can place them in the Application instance in your Global.asax's
Application_Start
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Application.Add("NumberOfRecords", 15)
...
End Sub
And access them via cint(Application("NumberOfRecords"))
There are more options, but those should do you fine.
Karl
"Don Wash" <do*@wash.com> wrote in message
news:uX**************@TK2MSFTNGP11.phx.gbl...
Hi There!
I'm trying to define constants so that I can refer those constants from
any page of my ASP.NET website. I know I can use <appSettings> in web.config
XML file but I don't want to parse and read the whole XML document everytime a
page is requested.
In classic ASP, I used Include files and define constants using Const
keyword so that every page that has been included the file can refer the
constants.
Is there any proper and easier way in ASP.NET to accomplish this? (and of
course without using web.config file)
Thanks all in advance!!
Don