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
What is the use of data set in asp.net?
Explain page output caching?
If I am developing an application that must accomodate multiple security levels though secure login and my asp.net web application is spanned across three web-servers (using round-robin load balancing). What would be the best approach to maintain login-in state for the users?
how to transfer the file from client to server using asp.net
How can you register a custom server control to a web page?
Explain the difference between sql invalidation and sql notification.
Explain what is event bubbling?
What are the server control tags in asp.net.?
What is the part of url?
What is a url string?
Explain diff. Between friend and protected friend?
How can we inherit a static variable?
How to rename a table using sql queries?
Explain the difference between page.registerclientscriptblock and page.registerstartupscript?
Explain global assembly cache.