public vars losing values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,

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
 
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,
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
 
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.
 
Back
Top