public vars losing values

Discussion in 'ASP .Net' started by =?Utf-8?B?Y0ZsZXVyeQ==?=, Jan 31, 2005.

  1. Hi,
    I have a public structure which is initialized only at startup time but at
    least one of the elements of this structure is losing its value, this
    particular element is ONLY initialized at the same time the structure is also
    initialized and nowhere else in the code. Worth mentioning here is that this
    behavior (losing its value) ONY happens when the code is executed outside the
    IDE, if executed from the IDE it will work ALLWAYS !!!

    Thanks

    C.Fleury
     
    =?Utf-8?B?Y0ZsZXVyeQ==?=, Jan 31, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?Y0ZsZXVyeQ==?=

    Scott Allen Guest

    Can you show us some code? By startup time - do you mean inside
    Application_Start?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/


    On Mon, 31 Jan 2005 08:11:04 -0800, "cFleury"
    <> wrote:

    >Hi,
    >I have a public structure which is initialized only at startup time but at
    >least one of the elements of this structure is losing its value, this
    >particular element is ONLY initialized at the same time the structure is also
    >initialized and nowhere else in the code. Worth mentioning here is that this
    >behavior (losing its value) ONY happens when the code is executed outside the
    >IDE, if executed from the IDE it will work ALLWAYS !!!
    >
    >Thanks
    >
    >C.Fleury
     
    Scott Allen, Jan 31, 2005
    #2
    1. Advertising

  3. Scott,

    I mean that the var (sys.BranchNbr) which is public and defined elsewhere is
    initialized at my Default.aspx.vb. See below the code sections involved in
    this:


    Module DTA
    Public Structure _sys
    Public Branch As String
    Public Session As String
    Public SessionOld As String
    Public DataType As String
    Public WebServerIP As String
    End Structure

    Public sys As _sys

    End Module

    In file Default.aspx.vb
    Public Class _Default
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    sys.Branch = "000"
    end sub

    End Class

    In file InvMaint.aspx.vb
    The var sys.Branch will be empty


    Thanks

    C.Fleury




    "Scott Allen" wrote:

    > Can you show us some code? By startup time - do you mean inside
    > Application_Start?
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    >
    > On Mon, 31 Jan 2005 08:11:04 -0800, "cFleury"
    > <> wrote:
    >
    > >Hi,
    > >I have a public structure which is initialized only at startup time but at
    > >least one of the elements of this structure is losing its value, this
    > >particular element is ONLY initialized at the same time the structure is also
    > >initialized and nowhere else in the code. Worth mentioning here is that this
    > >behavior (losing its value) ONY happens when the code is executed outside the
    > >IDE, if executed from the IDE it will work ALLWAYS !!!
    > >
    > >Thanks
    > >
    > >C.Fleury

    >
    >
     
    =?Utf-8?B?Y0ZsZXVyeQ==?=, Jan 31, 2005
    #3
  4. =?Utf-8?B?Y0ZsZXVyeQ==?=

    Scott Allen Guest

    That is odd - is there anything happening between Default.aspx and
    InvMaint.aspx that could be resetting the application? Like a change
    to web.config?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Mon, 31 Jan 2005 11:23:02 -0800, "cFleury"
    <> wrote:

    >Scott,
    >
    >I mean that the var (sys.BranchNbr) which is public and defined elsewhere is
    >initialized at my Default.aspx.vb. See below the code sections involved in
    >this:
    >
    >
    >Module DTA
    > Public Structure _sys
    > Public Branch As String
    > Public Session As String
    > Public SessionOld As String
    > Public DataType As String
    > Public WebServerIP As String
    > End Structure
    >
    > Public sys As _sys
    >
    >End Module
    >
    >In file Default.aspx.vb
    >Public Class _Default
    >Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    >System.EventArgs) Handles MyBase.Load
    > sys.Branch = "000"
    > end sub
    >
    >End Class
    >
    >In file InvMaint.aspx.vb
    > The var sys.Branch will be empty
    >
    >
    >Thanks
    >
    >C.Fleury
    >
    >
    >
    >
    >"Scott Allen" wrote:
    >
    >> Can you show us some code? By startup time - do you mean inside
    >> Application_Start?
    >>
    >> --
    >> Scott
    >> http://www.OdeToCode.com/blogs/scott/
    >>
    >>
    >> On Mon, 31 Jan 2005 08:11:04 -0800, "cFleury"
    >> <> wrote:
    >>
    >> >Hi,
    >> >I have a public structure which is initialized only at startup time but at
    >> >least one of the elements of this structure is losing its value, this
    >> >particular element is ONLY initialized at the same time the structure is also
    >> >initialized and nowhere else in the code. Worth mentioning here is that this
    >> >behavior (losing its value) ONY happens when the code is executed outside the
    >> >IDE, if executed from the IDE it will work ALLWAYS !!!
    >> >
    >> >Thanks
    >> >
    >> >C.Fleury

    >>
    >>
     
    Scott Allen, Jan 31, 2005
    #4
  5. Scott,
    I don’t know if this makes any sense, but at the top of my aspx file I had
    the line:
    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="InvMaint.aspx.vb"
    Inherits="DTA.InvMaint" validateRequest=false%>
    the section: “validateRequest=false†was added there by me but I can’t
    remember why, and since I remove it, it looks like the problem went away…any
    ideas ?

    Thanks

    C.Fleury

    "Scott Allen" wrote:

    > That is odd - is there anything happening between Default.aspx and
    > InvMaint.aspx that could be resetting the application? Like a change
    > to web.config?
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Mon, 31 Jan 2005 11:23:02 -0800, "cFleury"
    > <> wrote:
    >
    > >Scott,
    > >
    > >I mean that the var (sys.BranchNbr) which is public and defined elsewhere is
    > >initialized at my Default.aspx.vb. See below the code sections involved in
    > >this:
    > >
    > >
    > >Module DTA
    > > Public Structure _sys
    > > Public Branch As String
    > > Public Session As String
    > > Public SessionOld As String
    > > Public DataType As String
    > > Public WebServerIP As String
    > > End Structure
    > >
    > > Public sys As _sys
    > >
    > >End Module
    > >
    > >In file Default.aspx.vb
    > >Public Class _Default
    > >Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > >System.EventArgs) Handles MyBase.Load
    > > sys.Branch = "000"
    > > end sub
    > >
    > >End Class
    > >
    > >In file InvMaint.aspx.vb
    > > The var sys.Branch will be empty
    > >
    > >
    > >Thanks
    > >
    > >C.Fleury
    > >
    > >
    > >
    > >
    > >"Scott Allen" wrote:
    > >
    > >> Can you show us some code? By startup time - do you mean inside
    > >> Application_Start?
    > >>
    > >> --
    > >> Scott
    > >> http://www.OdeToCode.com/blogs/scott/
    > >>
    > >>
    > >> On Mon, 31 Jan 2005 08:11:04 -0800, "cFleury"
    > >> <> wrote:
    > >>
    > >> >Hi,
    > >> >I have a public structure which is initialized only at startup time but at
    > >> >least one of the elements of this structure is losing its value, this
    > >> >particular element is ONLY initialized at the same time the structure is also
    > >> >initialized and nowhere else in the code. Worth mentioning here is that this
    > >> >behavior (losing its value) ONY happens when the code is executed outside the
    > >> >IDE, if executed from the IDE it will work ALLWAYS !!!
    > >> >
    > >> >Thanks
    > >> >
    > >> >C.Fleury
    > >>
    > >>

    >
    >
     
    =?Utf-8?B?Y0ZsZXVyeQ==?=, Feb 1, 2005
    #5
  6. =?Utf-8?B?Y0ZsZXVyeQ==?=

    Scott Allen Guest

    That would be checking the request coming in from the browser to make
    sure the data doesn't contain any "malicious looking" data. This can
    help prevent people from uploading javascript to the server for cross
    site scripting attacks, for instance.

    As to why that setting might have been affecting the behavior of your
    program - I'm not sure. If the request validation sees something
    suspicious it should give an obvious error message.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/


    On Tue, 1 Feb 2005 06:39:08 -0800, "cFleury"
    <> wrote:

    >Scott,
    >I don’t know if this makes any sense, but at the top of my aspx file I had
    >the line:
    ><%@ Page Language="vb" AutoEventWireup="false" Codebehind="InvMaint.aspx.vb"
    >Inherits="DTA.InvMaint" validateRequest=false%>
    >the section: “validateRequest=false” was added there by me but I can’t
    >remember why, and since I remove it, it looks like the problem went away…any
    >ideas ?
    >
    >Thanks
    >
    >C.Fleury
    >
     
    Scott Allen, Feb 1, 2005
    #6
    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. Charles A. Lackman
    Replies:
    1
    Views:
    1,390
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    593
    SpamProof
    Oct 21, 2003
  3. Jon

    app vars and cache vars

    Jon, Dec 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    404
  4. Linuxguy123
    Replies:
    7
    Views:
    704
    Paddy O'Loughlin
    Feb 20, 2009
  5. caccolangrifata
    Replies:
    18
    Views:
    404
    Chris Torek
    Jul 22, 2011
Loading...

Share This Page