Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Variable scope

    What type of variable can you use that lasts between page refreshes is it
    possible or do i have to use session or a hidden field

    thanks


    Vincent V Guest

  2. Similar Questions and Discussions

    1. PHP variable scope bug in CT
      I have a page where I declare PHP variables which are then used inside an include file. When I try to edit the page in Contribute, I get a notice...
    2. [PHP-DEV][2] Variable Scope
      On Sunday, Aug 31, 2003, at 06:16 America/New_York, Ard Biesheuvel wrote: Nothing; I wish to concede: If you look further down the example, you...
    3. [PHP-DEV][1] Variable Scope
      Thank you for the first decent response. I concede. On Sunday, Aug 31, 2003, at 07:09 America/New_York, Zeev Suraski wrote: -- PHP Internals...
    4. [PHP-DEV] Variable Scope
      Variable scope is mediocre at best. For instances: $array = array(1, 2, 3, 4, 5); for ($i = 0; $i < 5; $i++) { $num = $array; echo $num;...
    5. Re[2]: [PHP-DEV] Variable Scope
      Hello LingWitt, - PHP is typeless - for doesn't span any declaration level and hence does not have its own symbol table - PHP is not c, not C++...
  3. #2

    Default Re: Variable scope

    you could use a public static property on a class,
    or
    Application[]
    or
    Cache[]
    or
    Session[]

    hth,
    Dave
    [url]www.aspNetEmail.com[/url]



    "Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
    news:OWCJ2DrQDHA.2312@TK2MSFTNGP12.phx.gbl...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >

    dave wanta Guest

  4. #3

    Default Re: Variable scope

    You can also try Viewstate["yourkey"] = "value" if you have viewstate
    enabled.

    George Zacharias.

    "Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
    news:OWCJ2DrQDHA.2312@TK2MSFTNGP12.phx.gbl...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >

    George Zacharias Guest

  5. #4

    Default Re: Variable scope

    Normally you'd use Session state, or Viewstate, or the Application object,
    or the Cache object, or Cookies. A hidden field could also work. They all
    have their trade offs.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
    news:OWCJ2DrQDHA.2312@TK2MSFTNGP12.phx.gbl...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >

    Steve C. Orr, MCSD Guest

  6. #5

    Default Re: Variable scope

    Vincent,

    it's called "buy a basic book on asp/aspx"
    or read the included on-line documentation. Some questions are just so
    basic that IMHO they don't belong here.


    "Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
    news:OWCJ2DrQDHA.2312@TK2MSFTNGP12.phx.gbl...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >

    David Waz... Guest

  7. #6

    Default Variable scope

    I have a class:

    class CFoo
    {
    private var myvar;

    function foo()
    {
    var xmlr:XML;
    xmlr=new XML();
    xmlr.onLoad=loader;
    function loader()
    {
    how can I access myvar from here??
    }
    xmlr.load("bla.txt");
    }
    }

    So How can I access myvar from function foo. If I cant how can I use
    xml object (or any other with event) without braking all possible
    programming rules?
    A.Cicak Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139