3
Reply

we want use some variable globally,where we declare the variable

Divya Parashar

Divya Parashar

17y
6.1k
0
Reply

    In ASP.NET 2.0, create a public class in App_code folder and create punblic static/shared variable.

    By this, you will get global variable

    To make a variable global (rather than public) you would add it to a class that is a singleton. A singleton helps to guarantee that there is only one instance of that class available at runtime.

    17y
    0

    Declare the variable as public.

    Another way is create a public class, define all the variables. You can globally access these variables.