Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > public vars losing values

Reply
Thread Tools

public vars losing values

 
 
=?Utf-8?B?Y0ZsZXVyeQ==?=
Guest
Posts: n/a
 
      01-31-2005
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
 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      01-31-2005
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"
<(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Y0ZsZXVyeQ==?=
Guest
Posts: n/a
 
      01-31-2005
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"
> <(E-Mail Removed)> 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

>
>

 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      01-31-2005
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"
<(E-Mail Removed)> 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"
>> <(E-Mail Removed)> 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

>>
>>


 
Reply With Quote
 
=?Utf-8?B?Y0ZsZXVyeQ==?=
Guest
Posts: n/a
 
      02-01-2005
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"
> <(E-Mail Removed)> 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"
> >> <(E-Mail Removed)> 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
> >>
> >>

>
>

 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      02-01-2005
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"
<(E-Mail Removed)> 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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSE 4 11-15-2006 02:40 AM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola Microsoft Certification 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSD 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd realexxams@yahoo.com Microsoft Certification 0 05-10-2006 02:35 PM
microsoft.public.dotnet.faqs,microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vb Charles A. Lackman ASP .Net 1 12-08-2004 07:08 PM



Advertisments