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
Can any body provide me the sample web application in asp.net
i want to implement grid view value in paypal site. so how to create this code in asp.net with C#
How would you turn off cookies on one page of your website?
Can the unique key be null?
Who is using asp.net?
what is publisher?
Should I delete cookies?
How would you get asp.net running in apache web servers?
Can we override the enablepartialrendering property of the scriptmanager class?
Explain how can you debug your .net application?
how can create login from create and written conde in asp.net
Elaborate differentiation between ViewState and SessionState?
How Session use Cookies in State Management?
What are the two Layouts supported by a Web form in ASP.NET?
What are html helpers in asp.net?