467,915 Members | 1,651 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

public vars losing values

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
Nov 19 '05 #1
  • viewed: 1059
Share:
5 Replies
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"
<cF*****@discussions.microsoft.com> 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


Nov 19 '05 #2
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"
<cF*****@discussions.microsoft.com> 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


Nov 19 '05 #3
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"
<cF*****@discussions.microsoft.com> 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"
<cF*****@discussions.microsoft.com> 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



Nov 19 '05 #4
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"
<cF*****@discussions.microsoft.com> 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"
<cF*****@discussions.microsoft.com> 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


Nov 19 '05 #5
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"
<cF*****@discussions.microsoft.com> wrote:
Scott,
I dont 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 cant
remember why, and since I remove it, it looks like the problem went awayany
ideas ?

Thanks

C.Fleury


Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Kenny Ashton | last post: by
1 post views Thread by webguynow | last post: by
32 posts views Thread by Neil Ginsberg | last post: by
2 posts views Thread by r.roest | last post: by
4 posts views Thread by =?Utf-8?B?SlA=?= | last post: by
5 posts views Thread by Ross | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.