Changing global variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JustinRU@gmail.com

    #1

    Changing global variables

    Hi,

    I'm pretty new to .NET and have (what I think) is a simple question. I
    have a program that contains a datagrid, which is bound to different
    sql queries depending on search criteria. I set an sqlStr string
    variable globally (above the page load) and then alter that variable
    within different subs. What I would like to know is how to keep that
    global variable updated, so that I can access it in subs with its most
    current content. (i.e. I set it in the page load and want a label in a
    another sub to take its most current value.) Do I need to make a
    function to keep the variable in and change the function each time a
    set the variables to something different?

  • Reg Edit

    #2
    Re: Changing global variables

    As you mention Page Load I'm assuming this is an ASP.NET application,
    in which case you can use a Session variable or Application variable to
    maintain the value.



    Comment

    Working...