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

How many types of sessions are there in asp net?

1003


How can you identify that the page is post back?

995


Explain the differences between managed and unmanaged code?

1046


Is there any property names “isnavigating”?

1055


Mention few asp.net validators.

1015


What are the contents of cookie?

1106


From which base class all web forms are inherited?

979


Tell me the code snippet to show how we can return 404 errors from HttpError?

1281


Can I read the hard disk serial # of the client computer using asp.net?

1096


Describe the master page.

957


Which is faster viewbag or viewdata?

966


Explain the purpose of storyboard.targetproperty.

948


Can you clarified A Web service can only be written in .NET or not?

1038


What is form submit?

960


Dataset is the disconnected environment. suppose if you are binding records to gridview (disconnected environment) and you are making changes to the the grid but before updating the database if any other user modify the data, how will you avoid such problem?

2156