Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 11th, 2006, 05:32 PM
su su is offline
Authorized User
 
Join Date: Nov 2006
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Global Variables in C#

Hi All,

I want to declare few global variable in my website's first page which I can use throughout the website. For ex. User_Login.

Among these global variables some of the values I will be getting it from database.

Does anybody have idea how to do this?

I am using C#.NET, Visual Web Developer & SQL Server 2000.

Please Help!
Reply With Quote
  #2 (permalink)  
Old December 11th, 2006, 06:13 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Global variables can be made available a number of ways.

One way is to place it in the cache, another is to place it in an Application variable, another is to provide a static member of a class.

That is just a few for starters. There are other ways as well.


Woody Z
http://www.learntoprogramnow.com
Reply With Quote
  #3 (permalink)  
Old December 11th, 2006, 06:18 PM
su su is offline
Authorized User
 
Join Date: Nov 2006
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay..I figured out that I need to use session["var"] for my application.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
global variables Komila ASP.NET 3.5 Basics 2 October 31st, 2008 01:14 PM
Global variables zarol Beginning PHP 3 May 10th, 2005 06:17 AM
Global variables ps124 ASP.NET 1.0 and 1.1 Basics 6 April 6th, 2004 02:48 PM
Maintaining Global variables tenikiwon Beginning PHP 1 June 19th, 2003 02:11 PM



All times are GMT -4. The time now is 05:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.