Global variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonathan Perkins

    #1

    Global variables

    How do i create global variables that keep their values
    after the form is postback, (i.e. when a button is
    clicked, etc.) Thank you very much.
  • Tu-Thach

    #2
    Global variables

    Can you be more specific? If you are talking about global
    variables, then the Application object can store variables
    that are accessible within the whole application.

    Tu-Thach
    [color=blue]
    >-----Original Message-----
    >How do i create global variables that keep their values
    >after the form is postback, (i.e. when a button is
    >clicked, etc.) Thank you very much.
    >.
    >[/color]

    Comment

    • Jonathan Perkins

      #3
      Global variables

      For instance, i would like to have four or five variables
      than can be read and written to from my subs and
      functions. The problem that i am having is that
      everytime a button (asp:button) is clicked these
      varaibles loose there values. When i try to only DIM the
      variables, when Page.IsPostBack = False, the functions
      can't initially see the variables and I recieve
      compliation errors. Thank you[color=blue]
      >-----Original Message-----
      >Can you be more specific? If you are talking about[/color]
      global[color=blue]
      >variables, then the Application object can store[/color]
      variables[color=blue]
      >that are accessible within the whole application.
      >
      >Tu-Thach
      >[color=green]
      >>-----Original Message-----
      >>How do i create global variables that keep their values
      >>after the form is postback, (i.e. when a button is
      >>clicked, etc.) Thank you very much.
      >>.
      >>[/color]
      >.
      >[/color]

      Comment

      • Jay B. Harlow [MVP - Outlook]

        #4
        Re: Global variables

        Jonathan,
        ASP.NET has a number of facilities to store variables between round trips
        with a client:

        The following may be helpful for you to review to find your options:
        http://msdn.microsoft.com/library/de...bFormState.asp

        Specifically:
        http://msdn.microsoft.com/library/de...tateOption.asp

        The following article provides a good overview of the 9 options available:
        http://msdn.microsoft.com/msdnmag/is...e/default.aspx

        Hope this helps
        Jay

        "Jonathan Perkins" <jon@igetnet.co m> wrote in message
        news:023801c34b d7$4846d7c0$a50 1280a@phx.gbl.. .[color=blue]
        > For instance, i would like to have four or five variables
        > than can be read and written to from my subs and
        > functions. The problem that i am having is that
        > everytime a button (asp:button) is clicked these
        > varaibles loose there values. When i try to only DIM the
        > variables, when Page.IsPostBack = False, the functions
        > can't initially see the variables and I recieve
        > compliation errors. Thank you[color=green]
        > >-----Original Message-----
        > >Can you be more specific? If you are talking about[/color]
        > global[color=green]
        > >variables, then the Application object can store[/color]
        > variables[color=green]
        > >that are accessible within the whole application.
        > >
        > >Tu-Thach
        > >[color=darkred]
        > >>-----Original Message-----
        > >>How do i create global variables that keep their values
        > >>after the form is postback, (i.e. when a button is
        > >>clicked, etc.) Thank you very much.
        > >>.
        > >>[/color]
        > >.
        > >[/color][/color]


        Comment

        Working...