AllExperts > Active Server Pages Programming (ASP) 
Search      
Active Server Pages Programming (ASP)
Volunteer
Answers to thousands of questions
 Home · More Active Server Pages Programming (ASP) Questions · Answer Library  · Encyclopedia ·
More Active Server Pages Programming (ASP) Answers
Question Library

Ask a question about Active Server Pages Programming (ASP)
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Srini Nagarajan
Expertise
I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience
Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.
 
   

You are here:  Experts > Computing/Technology > Business Software > Active Server Pages Programming (ASP) > global variables for asp.net

Active Server Pages Programming (ASP) - global variables for asp.net


Expert: Srini Nagarajan - 9/18/2007

Question
Hello,
Where do I define or initialize a session variable, or any other global variable for that matter in an asp.net project? In ASP there was a global.asa page there by default. I don't know what's used in ASP.Net. Could you please help? Thank you SO much!
Heidi

Answer
Hi

it stores in web.config file.  for storing database connection string and other info

something like this

<appSettings>
  <add key="MyName" value="Srini" />
</appSettings>


in the code

string MyName=ConfigurationSettings.AppSettings["MyName"];


Check for more info.

http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=106


-srini


Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.