Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Does web services support data reader like pom project?

873


How can we prepairing Interview

2286


How can we use Web API with ASP.NET Web Form?

1051


Why we are using mvc instead of asp.net? : Asp.Net MVC

977


Can one dll file contains the compiled code of more than one .net language?

953


What is the use of placeholder control?

958


Can you change a master page dynamically at runtime? How?

866


Why asp.net is better than php?

925


What can you do with asp.net?

891


Why do we need Sessions?

989


What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?

1114


Is session stored in browser?

908


What is the difference between “Web.config” and “Machine.Config”?

1084


How many types of session in ASP.NET

1033


What is sta?

918