where is declare global variable in asp.net and what is use
of global variable
Answer Posted / 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 |
Post New Answer View All Answers
Does web services support data reader like pom project?
How can we prepairing Interview
How can we use Web API with ASP.NET Web Form?
Why we are using mvc instead of asp.net? : Asp.Net MVC
Can one dll file contains the compiled code of more than one .net language?
What is the use of placeholder control?
Can you change a master page dynamically at runtime? How?
Why asp.net is better than php?
What can you do with asp.net?
Why do we need Sessions?
What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?
Is session stored in browser?
What is the difference between “Web.config” and “Machine.Config”?
How many types of session in ASP.NET
What is sta?