Global.asax.vb in Visual Studio .NET 2005

Discussion in 'ASP .Net' started by Nathan Sokalski, Jun 30, 2006.

  1. I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.
    Visual Studio .NET 2005 does not create the Global.asax files that Visual
    Studio .NET 2003 did, which I used for variables such as the location of my
    database. What is the conventional way of creating global variables for
    purposes like this in Visual Studio .NET 2005? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
     
    Nathan Sokalski, Jun 30, 2006
    #1
    1. Advertising

  2. re:
    > What is the conventional way of creating global variables for purposes like this in Visual Studio
    > .NET 2005? Thanks.


    "File", "New File", and select "Global Application Class".

    Then...code away global variables to your heart's content.



    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "Nathan Sokalski" <> wrote in message
    news:...
    >I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005. Visual Studio .NET
    >2005 does not create the Global.asax files that Visual Studio .NET 2003 did, which I used for
    >variables such as the location of my database. What is the conventional way of creating global
    >variables for purposes like this in Visual Studio .NET 2005? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
     
    Juan T. Llibre, Jun 30, 2006
    #2
    1. Advertising

  3. OK, but then how do I access this variable in all my pages? In 2003 this was
    a class named Global, and I would access variables by doing something like
    Global.connectionstring. However, doing what you told me just creates
    Global.asax, which is not a *.vb file. Maybe it doesn't need to be to access
    it however you access it in 2.0, but either way, I can't seem to figure out
    how to access it in 2.0. Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Juan T. Llibre" <> wrote in message
    news:...
    > re:
    >> What is the conventional way of creating global variables for purposes
    >> like this in Visual Studio .NET 2005? Thanks.

    >
    > "File", "New File", and select "Global Application Class".
    >
    > Then...code away global variables to your heart's content.
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > aspnetfaq.com : http://www.aspnetfaq.com/
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ===================================
    > "Nathan Sokalski" <> wrote in message
    > news:...
    >>I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET
    >>2005. Visual Studio .NET 2005 does not create the Global.asax files that
    >>Visual Studio .NET 2003 did, which I used for variables such as the
    >>location of my database. What is the conventional way of creating global
    >>variables for purposes like this in Visual Studio .NET 2005? Thanks.
    >> --
    >> Nathan Sokalski
    >>
    >> http://www.nathansokalski.com/
    >>

    >
    >
     
    Nathan Sokalski, Jun 30, 2006
    #3
  4. firstly, you don't need to copy this to all these groups. secondly, if you
    like 2003, you should use the WAP model for visual studio.

    --
    ________________________
    Warm regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    Professional VSTO.NET - Wrox/Wiley
    The O.W.C. Black Book with .NET
    www.lulu.com/owc, Amazon
    Blog: http://www.msmvps.com/blogs/alvin
    -------------------------------------------------------


    "Nathan Sokalski" <> wrote in message
    news:%23a2a$f%...
    > OK, but then how do I access this variable in all my pages? In 2003 this
    > was a class named Global, and I would access variables by doing something
    > like Global.connectionstring. However, doing what you told me just creates
    > Global.asax, which is not a *.vb file. Maybe it doesn't need to be to
    > access it however you access it in 2.0, but either way, I can't seem to
    > figure out how to access it in 2.0. Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> re:
    >>> What is the conventional way of creating global variables for purposes
    >>> like this in Visual Studio .NET 2005? Thanks.

    >>
    >> "File", "New File", and select "Global Application Class".
    >>
    >> Then...code away global variables to your heart's content.
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> aspnetfaq.com : http://www.aspnetfaq.com/
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ===================================
    >> "Nathan Sokalski" <> wrote in message
    >> news:...
    >>>I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET
    >>>2005. Visual Studio .NET 2005 does not create the Global.asax files that
    >>>Visual Studio .NET 2003 did, which I used for variables such as the
    >>>location of my database. What is the conventional way of creating global
    >>>variables for purposes like this in Visual Studio .NET 2005? Thanks.
    >>> --
    >>> Nathan Sokalski
    >>>
    >>> http://www.nathansokalski.com/
    >>>

    >>
    >>

    >
    >
     
    Alvin Bruney [MVP], Jun 30, 2006
    #4
  5. First, there is nothing wrong with "copying" the message to multiple groups
    (the message is only posted once, so it doesn't take up any more space on
    the server, and you only see it multiple time if you read all the groups).
    Do I prefer 2003? Yes, I do, but I want to learn 2005. If I procrastinate
    with my learning, where is that going to get me?
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
    news:OUhuix%...
    > firstly, you don't need to copy this to all these groups. secondly, if you
    > like 2003, you should use the WAP model for visual studio.
    >
    > --
    > ________________________
    > Warm regards,
    > Alvin Bruney [MVP ASP.NET]
    >
    > [Shameless Author plug]
    > Professional VSTO.NET - Wrox/Wiley
    > The O.W.C. Black Book with .NET
    > www.lulu.com/owc, Amazon
    > Blog: http://www.msmvps.com/blogs/alvin
    > -------------------------------------------------------
    >
    >
    > "Nathan Sokalski" <> wrote in message
    > news:%23a2a$f%...
    >> OK, but then how do I access this variable in all my pages? In 2003 this
    >> was a class named Global, and I would access variables by doing something
    >> like Global.connectionstring. However, doing what you told me just
    >> creates Global.asax, which is not a *.vb file. Maybe it doesn't need to
    >> be to access it however you access it in 2.0, but either way, I can't
    >> seem to figure out how to access it in 2.0. Thanks.
    >> --
    >> Nathan Sokalski
    >>
    >> http://www.nathansokalski.com/
    >>
    >> "Juan T. Llibre" <> wrote in message
    >> news:...
    >>> re:
    >>>> What is the conventional way of creating global variables for purposes
    >>>> like this in Visual Studio .NET 2005? Thanks.
    >>>
    >>> "File", "New File", and select "Global Application Class".
    >>>
    >>> Then...code away global variables to your heart's content.
    >>>
    >>>
    >>>
    >>> Juan T. Llibre, asp.net MVP
    >>> aspnetfaq.com : http://www.aspnetfaq.com/
    >>> asp.net faq : http://asp.net.do/faq/
    >>> foros de asp.net, en español : http://asp.net.do/foros/
    >>> ===================================
    >>> "Nathan Sokalski" <> wrote in message
    >>> news:...
    >>>>I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET
    >>>>2005. Visual Studio .NET 2005 does not create the Global.asax files that
    >>>>Visual Studio .NET 2003 did, which I used for variables such as the
    >>>>location of my database. What is the conventional way of creating global
    >>>>variables for purposes like this in Visual Studio .NET 2005? Thanks.
    >>>> --
    >>>> Nathan Sokalski
    >>>>
    >>>> http://www.nathansokalski.com/
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Nathan Sokalski, Jun 30, 2006
    #5
  6. Nathan,

    See my answer on your next question.

    Cor

    "Nathan Sokalski" <> schreef in bericht
    news:...
    >I recently upgraded from Visual Studio .NET 2003 to Visual Studio .NET
    >2005. Visual Studio .NET 2005 does not create the Global.asax files that
    >Visual Studio .NET 2003 did, which I used for variables such as the
    >location of my database. What is the conventional way of creating global
    >variables for purposes like this in Visual Studio .NET 2005? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
     
    Cor Ligthert [MVP], Jun 30, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wh
    Replies:
    2
    Views:
    531
    Cowboy \(Gregory A. Beamer\)
    Jan 16, 2004
  2. =?Utf-8?B?YmNoYXJsZXM=?=

    global.asax and global.asax.cs

    =?Utf-8?B?YmNoYXJsZXM=?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    841
    =?Utf-8?B?YmNoYXJsZXM=?=
    Oct 5, 2004
  3. Ben Fidge
    Replies:
    0
    Views:
    1,823
    Ben Fidge
    Feb 26, 2006
  4. Mark Rae

    Global.asax / Global.asax.cs in v2

    Mark Rae, May 23, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,165
    Mark Rae
    May 23, 2006
  5. rockdale
    Replies:
    1
    Views:
    621
    Juan T. Llibre
    Aug 23, 2006
Loading...

Share This Page