Setting up global variable in asp.net vb.net.

How should I setup the following global variables in asp.net 2.0.

'Variables servant a referrer la Division (ainsi que la BD associee a cette division)
    Dim strActiveDivision
    Dim strActiveDivisionName
    Dim strActiveGenericName
    Dim strActiveIHDBName
    Dim strActiveIHServerName
    Dim strActiveIHConnection
    Dim strActiveMADBName
    Dim strActiveMAServerName
    Dim strActiveMAConnection
    Dim strActiveMWDBName
    Dim strActiveMWServerName
    Dim strActiveMWConnection
    Dim strActiveAWDBName
    Dim strActiveAWServerName
    Dim strActiveAWConnection
    Dim strActiveReport2WebName

    Dim DivisionLevel, ClassLevel, SubDeptLevel, DeptLevel, RegionLevel, ClassLength, SubDeptLength, DeptLength
    Dim SubClassLevel, SubClassLength, OnHandAvailable, OnHandInTransit
    Dim mstrYearPeriod
Where should the above global variables go. I am trying to transform this application from asp classic
to asp.net.

    Public GetDivisionValuesinArrary()

    strTmp  = Request.Form("selDivision")
    ' The division here needed to be populated with the appropriate value.
    ' The dropdownlist box has two values ddlDivisions in the dropdownbox

      arrTmp = Split(strTmp,";")
      If IsArray(arrTmp) then
            strActiveDivision = arrTmp(0)
            strActiveDivisionName = arrTmp(1)
            strActiveGenericName = arrTmp(2)
            strActiveIHServerName = arrTmp(3)
            strActiveIHDBName = arrTmp(4)
            strActiveAWServerName = arrTmp(5)
            strActiveAWDBName = arrTmp(6)            
            strActiveMAServerName = arrTmp(7)
            strActiveMADBName = arrTmp(8)
            strActiveMWServerName = arrTmp(9)
            strActiveMWDBName = arrTmp(10)
            strActiveReport2WebName = arrTmp(11)                                                      
            DivisionLevel = arrTmp(12)      
            DeptLevel = arrTmp(13)      
            SubDeptLevel = arrTmp(14)      
            ClassLevel = arrTmp(15)                  
            DeptLength = arrTmp(16)      
            SubDeptLength = arrTmp(17)      
            ClassLength = arrTmp(18)                  
            OnhandAvailable = arrTmp(19)      
            OnhandInTransit = arrTmp(20)      

      end if

      mstrYearPeriod = txtMonthTo.Txt ''''Get value from text box

End Sub



This will need to be a class that should be called in many apps.

I must setup the subroutine to return an array as well.
mathieu_cuprykAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

crisco96Commented:
Put the variables in a new class and declare them public.  You can then declare a new instance of the class and then access the variables.

Option Strict On
Option Explicit On

Public Class Globals
      Public strActiveDivision As String
      Public strActiveDivisionName As String
      Public strActiveGenericName As String
      Public strActiveIHDBName As String
      Public strActiveIHServerName As String
      Public strActiveIHConnection As String
      Public strActiveMADBName As String
      Public strActiveMAServerName As String
      Public strActiveMAConnection As String
      Public strActiveMWDBName As String
      Public strActiveMWServerName As String
      Public strActiveMWConnection As String
      Public strActiveAWDBName As String
      Public strActiveAWServerName As String
      Public strActiveAWConnection As String
      Public strActiveReport2WebName As String
      Public DivisionLevel As String
      Public ClassLevel As String
      Public SubDeptLevel As String
      Public DeptLevel As String
      Public RegionLevel As String
      Public ClassLength As String
      Public SubDeptLength As String
      Public DeptLength As String
      Public SubClassLevel As String
      Public SubClassLength As String
      Public OnHandAvailable As String
      Public OnHandInTransit As String
      Public mstrYearPeriod As String

      Public Sub New()
            Dim strTmp As String = System.Web.HttpContext.Current.Request.Form("selDivision")
            ' The division here needed to be populated with the appropriate value.
            ' The dropdownlist box has two values ddlDivisions in the dropdownbox

            Dim arrTmp() As String = Split(strTmp, ";")

            If IsArray(arrTmp) Then
                  strActiveDivision = arrTmp(0)
                  strActiveDivisionName = arrTmp(1)
                  strActiveGenericName = arrTmp(2)
                  strActiveIHServerName = arrTmp(3)
                  strActiveIHDBName = arrTmp(4)
                  strActiveAWServerName = arrTmp(5)
                  strActiveAWDBName = arrTmp(6)
                  strActiveMAServerName = arrTmp(7)
                  strActiveMADBName = arrTmp(8)
                  strActiveMWServerName = arrTmp(9)
                  strActiveMWDBName = arrTmp(10)
                  strActiveReport2WebName = arrTmp(11)
                  DivisionLevel = arrTmp(12)
                  DeptLevel = arrTmp(13)
                  SubDeptLevel = arrTmp(14)
                  ClassLevel = arrTmp(15)
                  DeptLength = arrTmp(16)
                  SubDeptLength = arrTmp(17)
                  ClassLength = arrTmp(18)
                  OnHandAvailable = arrTmp(19)
                  OnHandInTransit = arrTmp(20)
            End If
      End Sub
End Class
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mathieu_cuprykAuthor Commented:
I need two classes one for
getting values for the divisions

 Public GetDivisionValuesinArrary()

and then hidding the globals.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.