public vars losing values

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
 
S

Scott Allen

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

Guest

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
 
S

Scott Allen

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?
 
G

Guest

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
 
S

Scott Allen

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top