|
-
Apr 21st, 2005, 04:05 AM
#1
Thread Starter
Fanatic Member
Changes to Global.asax.vb
I have developed a VB.NET/ASP.NET application and am using the Global.asax.vb file to store some constants which are written to Application variables in the Application_Start event.
In development mode, I can make changes to the values of the constants, and when I build and run the application, these changes take effect as expected.
However, when I access my ASP application by simply navigating to my LocalHost (outside of the Visual Studio environment), any changes I make to the Global.asax.vb file are ignored.
Why is this?
Last edited by simonm; Apr 21st, 2005 at 06:14 AM.
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 21st, 2005, 04:38 AM
#2
Re: Changes to Global.asax.vb
Any changes you make to any of the .vb files in the app will be ignored unless you Ctrl+Shift+B
-
Apr 21st, 2005, 04:49 AM
#3
Thread Starter
Fanatic Member
Re: Changes to Global.asax.vb
Where abouts do I hit ctrl+shift+B? What does it do?
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 21st, 2005, 04:52 AM
#4
Re: Changes to Global.asax.vb
I meant "Build Solution." Every time you change something in the .vb files, build the solution again so that it gets compiled into your DLL. Ctrl+Shift+B is a keyboard shortcut many of us use to build the solution.
-
Apr 21st, 2005, 04:54 AM
#5
Thread Starter
Fanatic Member
Re: Changes to Global.asax.vb
So the .vb files are not necessary to be deployed on the web server? It just uses the compiled DLL?
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 21st, 2005, 05:11 AM
#6
Re: Changes to Global.asax.vb
-
Apr 21st, 2005, 05:12 AM
#7
Re: Changes to Global.asax.vb
And the ASPX pages of course, and the Global.ASAX fiels and your user controls and web.config... and stuff.
-
Apr 21st, 2005, 05:38 AM
#8
Thread Starter
Fanatic Member
Re: Changes to Global.asax.vb
Do I not need to deploy anything but the compiled dlls then?
What I really want to do is allow the administrator at each web server that hosts my web project to be able to edit the database connection details...so that I can obtain these details when my application starts and build by database connection string accordingly.
What would be the best way to do this?
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 21st, 2005, 05:47 AM
#9
Re: Changes to Global.asax.vb
 Originally Posted by simonm
What I really want to do is allow the administrator at each web server that hosts my web project to be able to edit the database connection details...so that I can obtain these details when my application starts and build by database connection string accordingly.
What would be the best way to do this?
Put your connection string in your web.config file. Since it's text based, your admin can open that file in notepad, edit that line and save it.
-
Apr 21st, 2005, 06:05 AM
#10
Thread Starter
Fanatic Member
Re: Changes to Global.asax.vb
Funnilly enough, I tried putting something in my web.config file but wherever I tried to put the text, I got errors.
Could you possibly explain how I can add these details to my web.config file and then also how I would access these details in VB?
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 21st, 2005, 06:07 AM
#11
Re: Changes to Global.asax.vb
In web.config
Code:
<appSettings>
<add key="ConnectionString" Value="Provider = your mom" />
</appSettings>
To access it in code,
VB Code:
Dim strConn As String
strConn = ConfigurationSettings.AppSettings("ConnectionString")
-
Apr 21st, 2005, 06:13 AM
#12
Thread Starter
Fanatic Member
Re: Changes to Global.asax.vb
Ah, cheers man. You are a lifesaver!
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 21st, 2005, 06:18 AM
#13
Re: Changes to Global.asax.vb
I know... just ask Seinfeld.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|