Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Global.asax.vb in Visual Studio .NET 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Sokalski - 30 Jun 2006 00:43 GMT
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.
Signature

Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

Juan T. Llibre - 30 Jun 2006 01:08 GMT
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/
===================================
>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 - 30 Jun 2006 02:53 GMT
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.
Signature

Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

> re:
>> What is the conventional way of creating global variables for purposes
[quoted text clipped - 14 lines]
>>location of my database. What is the conventional way of creating global
>>variables for purposes like this in Visual Studio .NET 2005? Thanks.
Alvin Bruney [MVP] - 30 Jun 2006 03:24 GMT
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.

Signature

________________________
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
-------------------------------------------------------

> 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
[quoted text clipped - 20 lines]
>>>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 - 30 Jun 2006 03:44 GMT
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?
Signature

Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

> 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.
[quoted text clipped - 23 lines]
>>>>location of my database. What is the conventional way of creating global
>>>>variables for purposes like this in Visual Studio .NET 2005? Thanks.
Cor Ligthert [MVP] - 30 Jun 2006 06:30 GMT
Nathan,

See my answer on your next question.

Cor

>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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.