where is declare global variable in asp.net and what is use
of global variable
Answers were Sorted based on User's Feedback
Answer / sridhar
ou can use web.config to store global varriables
<appSettings>
<!-- Generic Settings -->
<add key="PDFBaseDir" value="\\server\pdfs\"/>
</appSettings>
PDFBaseDir Can be used across application
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / sridhar
For Classes to be generally consumable across your site you should place them in APP_CODE folder.
This simple class will provide global variable
imports Microsoft.VisualBasic
Public Class Sample
Public Shared Text as String ="Global Variable Example"
End Class
Using it in a page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Me.Title = Sample.Text
End Sub
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / kinjal panchal
we can declare global variable in class file. and this
global variable we can use in whole application.
| Is This Answer Correct ? | 2 Yes | 0 No |
What is the appSettings Section in the web.config file?
What is the biggest disadvantage of “Other Return Types” in Web API?
How Web Service help? What is the difference between Remoting & Web Servcies?
Define the term Web Garden?
0 Answers Sans Pareil IT Services,
what is loosely coupled solution? How it can be used?
Do session use cookies in asp net?
which one is more flexibility and reliability and durability asp.net (VS)php which one is best and which one we do nice to create dynamic websites
What are the different ways you would consider sending data across pages in ASP (i.e between 1.asp to 2.asp)?
what is state management,what is the purpose of it,how it will be implemented in real time?
What is ipostback?
What is CLS?
5 Answers IBM, PrimeLine, TCS,
What is the difference between Session and response.Redirect?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)