473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

asp.net/global.asax application variable

This is a real basic question.

How can I use a variable that I have included in global.asax in my webform
in a web application?

Thanks for your help in advance. Would appreciate any help.
Jul 21 '05 #1
2 4479
Hi,

You can use the Application() object:

Application("MyVariable") = "A Test String"

Then in your app you can use Application("MyVariable") wherever you want and
change it whenever you want. Remember though that all users will share
this, so if you change it all the users will see the change immedieately.
If you want a seperate instance for each variable then use
Session("MyVariable") instead. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"newbieaspnet" <ne**********@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
This is a real basic question.

How can I use a variable that I have included in global.asax in my webform
in a web application?

Thanks for your help in advance. Would appreciate any help.

Jul 21 '05 #2
Thanks Ken. I appreciate your help.
"Ken Dopierala Jr." wrote:
Hi,

You can use the Application() object:

Application("MyVariable") = "A Test String"

Then in your app you can use Application("MyVariable") wherever you want and
change it whenever you want. Remember though that all users will share
this, so if you change it all the users will see the change immedieately.
If you want a seperate instance for each variable then use
Session("MyVariable") instead. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"newbieaspnet" <ne**********@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
This is a real basic question.

How can I use a variable that I have included in global.asax in my webform
in a web application?

Thanks for your help in advance. Would appreciate any help.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve Chatham | last post by:
I have a webserver that has both a global.asa and global.asax on the IIS server. We're running both a dotnet and a traditional ASP application on that web server. In the global.asa I set up a...
2
by: Ekul | last post by:
I have an application that allows users to login and logout. I track how many users are logged in and when each individual is logged in. The application will not allow concurrent logins(let a...
6
by: Andrea Williams | last post by:
Where is the best place to put global variables. In traditional ASP I used to put all of them into an include file and include it in every page. Will the Global.aspx.cs do that same thing? ...
5
by: WJ | last post by:
I am attempting to use the Global.Asax to store my user's configuration. Here is the concept: 1. User logs on into the site using Form Authentication. 2. I capture the user Credential, verify it...
2
by: PRTC | last post by:
I'm trying to use the global.asax in my new web aplication proyect using the Application start to store my connection string GLOBAL.ASAX.vb Sub Application_Start(ByVal sender As Object,...
15
by: randyr | last post by:
I am developing an asp.net app based on a previous asp application. in the asp applications global.asa file I had several <object id="id" runat="server" scope="scope" class="comclass"> tags for...
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
8
by: Thomas Coleman | last post by:
Ok, I've obviously discovered that Global.aspx has been completely changed in ..NET 2.0. However, I haven't figured out how to declare a constant that's available to any page in my application...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.