|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Global Variables!qHi all,
I am still new to .net. Coming from an asp classic background. Using classic asp, i would use a include file to contain global variables contained through out a site. These would normally be file system paths and the like. What would be the best approach to achieving this in dotnet. Because they are only variables using a class seems overkills so does a user control. Thanks for any replies!! If the variable is same to all users, so you can add them to the cach.
Regards Saeid Kdaimati Show quoteHide quote "Child X" wrote: > Hi all, > > I am still new to .net. > Coming from an asp classic background. > > Using classic asp, i would use a include file to contain global variables > contained through out a site. These would normally be file system paths and > the like. > > What would be the best approach to achieving this in dotnet. > Because they are only variables using a class seems overkills so does a user > control. > > Thanks for any replies!! Depends upon what youre global variable is for. If it's something like a
connection string, which was typically stored in global.asa in classic ASP, then I'd suggest putting that value into the <appSettings> section of web.config. http://www.dotnetjunkies.com/QuickStart/aspplus/default.aspx?url=/quickstart/aspplus/doc/configretrieve.aspx If instead the variable is an actual constant, then I'd suggest looking into static (C#)/Shared (VB.NET) variables. staic/Shared means there's one shared copy of the variable for the entire application. -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi all, > > I am still new to .net. > Coming from an asp classic background. > Using classic asp, i would use a include file to contain global > variables contained through out a site. These would normally be file > system paths and the like. > > What would be the best approach to achieving this in dotnet. > Because they are only variables using a class seems overkills so does > a user > control. > Thanks for any replies!! >
Other interesting topics
SqlParameters SqlDbType.Char in VB Question
DataGrid Runtime DropDown - ViewState Issue Evaluation Application How to get network user name with FORMS authentication Reading values from a Word document... Two DropDownLists getting crossed validating Getting more detailed errors interesting fact about date. How to hide aspx from URL in address bar |
|||||||||||||||||||||||