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 dataset ?
18 Answers Infosys, Kuwait University,
Which is the namespace used to write error message in event Log File?
What is meant by asp.net?
How many no of classes in .net
How can you apply a theme to your asp.net application?
What is gacutil.exe? Where do we store assemblies, Should sn.exe be used before gacutil.exe?
Interface and Abstract class, inheritance, abstraction with examples. Polymorphism (difference betn overloading and overriding
Explain the difference between inline and code behind - which is best in?
Can we set which type of comparison we want to perform by the CompareValidator control?
What is the DLL Hell Problem?
Difference between datareader and dataset ?
What would be the salary of an Asp.net developer with 1 and half year experience in indian rupees..??