application session

Discussion in 'ASP .Net' started by simon, Sep 22, 2005.

  1. simon

    simon Guest

    In global.asax.vb I have:

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    ' Fires when the application is started
    Application("OZN") = "HUF"
    End Sub

    But then on some the page nothing shows:

    <%=Application("OZN")%>

    What that could be?

    No error message and normal session also work. For example:

    sesion("test")= "HUF" works.

    Just application session won't work.

    Any idea why?

    Thanks,S
    simon, Sep 22, 2005
    #1
    1. Advertising

  2. simon

    Mr Newbie Guest

    I think the binding statement have to be to a public variable of the
    webform. In addition you have to run Page.DataBind during Page_Load event to
    make it appear.

    Have not tied this directly for globals, but if it doesent work then you
    could allways assign the global to the page public variable before databind
    occurs


    "simon" <> wrote in message
    news:...
    > In global.asax.vb I have:
    >
    > Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    > ' Fires when the application is started
    > Application("OZN") = "HUF"
    > End Sub
    >
    > But then on some the page nothing shows:
    >
    > <%=Application("OZN")%>
    >
    > What that could be?
    >
    > No error message and normal session also work. For example:
    >
    > sesion("test")= "HUF" works.
    >
    > Just application session won't work.
    >
    > Any idea why?
    >
    > Thanks,S
    >
    Mr Newbie, Sep 22, 2005
    #2
    1. Advertising

  3. simon

    Bruce Barker Guest

    <%= %> is not a binding syntax, so there is no need to do a databind. either
    the Application_Start event is not firing, or you have code that clears the
    value.

    -- bruce (sqlwork.com)



    "Mr Newbie" <> wrote in message
    news:...
    >I think the binding statement have to be to a public variable of the
    >webform. In addition you have to run Page.DataBind during Page_Load event
    >to make it appear.
    >
    > Have not tied this directly for globals, but if it doesent work then you
    > could allways assign the global to the page public variable before
    > databind occurs
    >
    >
    > "simon" <> wrote in message
    > news:...
    >> In global.asax.vb I have:
    >>
    >> Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    >> ' Fires when the application is started
    >> Application("OZN") = "HUF"
    >> End Sub
    >>
    >> But then on some the page nothing shows:
    >>
    >> <%=Application("OZN")%>
    >>
    >> What that could be?
    >>
    >> No error message and normal session also work. For example:
    >>
    >> sesion("test")= "HUF" works.
    >>
    >> Just application session won't work.
    >>
    >> Any idea why?
    >>
    >> Thanks,S
    >>

    >
    >
    Bruce Barker, Sep 22, 2005
    #3
  4. simon

    Mr Newbie Guest

    I misread the text then. Is <% functionaName() % > A way of binding ( Or
    whatever term you want to use ) to the return value of a global function ?

    Thanks in advance



    "Bruce Barker" <> wrote in message
    news:...
    > <%= %> is not a binding syntax, so there is no need to do a databind.
    > either the Application_Start event is not firing, or you have code that
    > clears the value.
    >
    > -- bruce (sqlwork.com)
    >
    >
    >
    > "Mr Newbie" <> wrote in message
    > news:...
    >>I think the binding statement have to be to a public variable of the
    >>webform. In addition you have to run Page.DataBind during Page_Load event
    >>to make it appear.
    >>
    >> Have not tied this directly for globals, but if it doesent work then you
    >> could allways assign the global to the page public variable before
    >> databind occurs
    >>
    >>
    >> "simon" <> wrote in message
    >> news:...
    >>> In global.asax.vb I have:
    >>>
    >>> Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    >>> ' Fires when the application is started
    >>> Application("OZN") = "HUF"
    >>> End Sub
    >>>
    >>> But then on some the page nothing shows:
    >>>
    >>> <%=Application("OZN")%>
    >>>
    >>> What that could be?
    >>>
    >>> No error message and normal session also work. For example:
    >>>
    >>> sesion("test")= "HUF" works.
    >>>
    >>> Just application session won't work.
    >>>
    >>> Any idea why?
    >>>
    >>> Thanks,S
    >>>

    >>
    >>

    >
    >
    Mr Newbie, Sep 22, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    1
    Views:
    444
    Steve C. Orr, MCSD
    Jul 23, 2003
  2. shamanthakamani
    Replies:
    1
    Views:
    3,469
    Natty Gur
    Nov 20, 2003
  3. Jeff Smythe
    Replies:
    3
    Views:
    1,227
    Jeff Smythe
    Jan 2, 2004
  4. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,252
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  5. Jazzis
    Replies:
    2
    Views:
    233
    Jazzis
    Sep 23, 2003
Loading...

Share This Page