Application variables

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

  1. #1

    Default Application variables

    Hi,

    What is the best way to maintain a value across multiple pages. I could of
    course send the value by URL request, but I feel there should be a better
    way.
    Is the Session object the right way to go about it?

    What I want is for the User to select a setting on the first page and then
    this setting should be stored somewhere for the duration of the visit.

    Thanks,
    Philip


    Philip Carnstam Guest

  2. Similar Questions and Discussions

    1. Problem with Application variables using Application.cfc
      Hi guys, I'm using CFMX7 and with that the Application.cfc. I've defined the app variables using <cfset This.varname = "something"> I would like...
    2. application variables in a CFC
      I have some application variables declared in my Application.cfm file, and I want to be able to use them in my CFC. However, I've noticed that if...
    3. need help on application variables
      Hi, I need help on the usage of application variables... Can I populate application variables through my console application and use them in...
    4. DB Field name="application" and Application scope variables
      Hi, There is DB Field application which overwrited ,as I see , Application scope variable Are there way to solve this problem without using...
    5. Global variables - application variables vs include file
      What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include...
  3. #2

    Default Application Variables

    Hi,

    I store a couple of application variables, but on one IIS server, the values
    aren't saved. here's my global.asa...

    <script language=vbscript runat=server>

    Sub Application_OnStart
    Application("CompanyName") = "Company Name"
    Application("NovellNetware") = "false"
    End Sub

    </script>

    the odd thing is that it 'seems' to be to do with whether I use

    <script language=vbscript runat=server>

    or

    <script language="vbscript" runat="server">

    I didn't think it mattered which you used, my pref would be with the quotes.
    Unfortunately, this one server works with the opposite to all the others
    I've so far encountered.

    Anyone got any ideas?

    TIA

    Cesare


    Cesare Guest

  4. #3

    Default Re: Application Variables

    global.asa will not be fired if the virtual directory is not marked as an
    application. Instead, the global.asa from the root of the web site will be
    used. (See [url]http://www.aspfaq.com/2076[/url])

    Why not just do this in a common include file, instead of relying on
    global.asa?

    if application("CompanyName") = "" then
    application("CompanyName") = "Company Name"
    ...
    end if





    "Cesare" <a@b.c> wrote in message
    news:UbAhb.744$gj2.694@news-binary.blueyonder.co.uk...
    > Hi,
    >
    > I store a couple of application variables, but on one IIS server, the
    values
    > aren't saved. here's my global.asa...
    >
    > <script language=vbscript runat=server>
    >
    > Sub Application_OnStart
    > Application("CompanyName") = "Company Name"
    > Application("NovellNetware") = "false"
    > End Sub
    >
    > </script>
    >
    > the odd thing is that it 'seems' to be to do with whether I use
    >
    > <script language=vbscript runat=server>
    >
    > or
    >
    > <script language="vbscript" runat="server">
    >
    > I didn't think it mattered which you used, my pref would be with the
    quotes.
    > Unfortunately, this one server works with the opposite to all the others
    > I've so far encountered.
    >
    > Anyone got any ideas?
    >
    > TIA
    >
    > Cesare
    >
    >

    Aaron Bertrand - MVP Guest

  5. #4

    Default Application variables

    Hey guys!!
    I am building this application that I want users to log into my system with
    their login and password stored on a DB.
    After I do the check I want to clear them to access a specific folder on my
    website that will be restricted only to them.
    What is the best way to create an application variable file that will store
    the user information and a specific timeout for when the user stops using
    the system it kicks him out back to the login screen.
    Is there a way to do this in ASP.NET?
    I am familiar with ColdFusion but never done it with ASP.
    Any help is appreciated,

    Teo


    Teo Guest

  6. #5

    Default Re: Application variables

    Teo wrote:
    > I am building this application that I want users to log into my system with
    > their login and password stored on a DB.
    > After I do the check I want to clear them to access a specific folder on my
    > website that will be restricted only to them.
    > What is the best way to create an application variable file that will store
    > the user information and a specific timeout for when the user stops using
    > the system it kicks him out back to the login screen.
    > Is there a way to do this in ASP.NET?
    > I am familiar with ColdFusion but never done it with ASP.
    Teo, this is probably not the best newsgroup to ask this, try the
    microsoft.public.dotnet.framework.aspnet newsgroup instead next time.
    This newsgroup is for discussions on building custom, compiled server
    controls.

    In any event, ASP.NET 1.x does provide an easy-to-use forms-based
    authentication piece, see this article for more info:

    Using Forms-Based Authentication in ASP.NET
    [url]http://www.4guysfromrolla.com/webtech/110701-1.shtml[/url]

    ASP.NET 2.0 provides the membership functionality which makes doing this
    stuff REALLY easy.

    --

    Scott Mitchell [ASP.NET MVP]
    [email]mitchell@4GuysFromRolla.com[/email]
    [url]http://www.4GuysFromRolla.com/ScottMitchell[/url]
    Scott Mitchell [MVP] 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