Showing posts with label vsnet. Show all posts
Showing posts with label vsnet. Show all posts

Saturday, March 31, 2012

Straight ASP in VS.NET Question

All,
I have to set up a web server to handle
the following call:
<server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}
I'm pretty lightweight in ASP.NET and a pure noob
in straight ASP. What's the easiest way to set
up a simple server page to grab these three parms
and invoke a method in my managed assembly?
Thank you,
~swoozin the page_load just add some Request.QueryString() calls, maybe a simple
switch() statement.
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111071784.152396.227780@.o13g2000cwo.googlegroups.com...
> All,
> I have to set up a web server to handle
> the following call:
> <server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}
> I'm pretty lightweight in ASP.NET and a pure noob
> in straight ASP. What's the easiest way to set
> up a simple server page to grab these three parms
> and invoke a method in my managed assembly?
> Thank you,
> ~swooz
>
Curt_C [MVP] wrote:
> in the page_load just add some Request.QueryString() calls, maybe a
simple
> switch() statement.
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
Curt, thanks for the reply. I am still unsure
how to handle the "Submit.asp" in the URL. Do
I need to create a straight ASP page to handle
this? And there's the issue with ending up
in managed code with the parm values.
Thanks a lot!
~swooz
It's all yours now, Curt. -)
Kevin Spencer
Microsoft MVP
.Net Developer
What You S Is What You Get.
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegroups.com...
> Curt_C [MVP] wrote:
> simple
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
>
huh? that makes little sense to me.....
Is this .ASP or .ASPX where you are trying to read the querystring values?
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegroups.com...
> Curt_C [MVP] wrote:
> simple
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
>
I got the feeling I missed something, but thanks for the warning :}
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:eKvNk0wKFHA.2648@.TK2MSFTNGP14.phx.gbl...
> It's all yours now, Curt. -)
> --
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You S Is What You Get.
> "swoozie" <swooziep@.yahoo.com> wrote in message
> news:1111076028.221406.316920@.f14g2000cwb.googlegroups.com...
>
I'm sorry if I wasn't clear. The HTTP GET is from a 3rd-party
client, so I have to handle the URL with ".asp" in it (see above).
If I can handle that with ASP.NET, great! Can I set up a redirect
to an ASPX? Either way, I need to end up with the parms
in a managed assembly, be it web tier or middle. I'm fairly new
to this, so apologies in advance. And thanks so much for the help.
~swooz
One more post to further clarify! ;-)
I am assuming since they're throwing ".asp" at me
that I need to have a classic ASP page on the web
server.
you mean that THEY are pointing to YOUR site like this:
http://www.yoursite.com/submit.asp?parm1={1}&parm2={2}&parm3={3}
If so, few things...
1) wrong group, this is a .NET group.
2) you will need a page on your server called "submit.asp"
3) in that page you will need:
- myValue1 = Request.QueryString("param1")
- myValue2 = Request.QueryString("param2")
- myValue3 = Request.QueryString("param3")
that clarify it for ya?
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111079290.380858.246130@.f14g2000cwb.googlegroups.com...
> One more post to further clarify! ;-)
> I am assuming since they're throwing ".asp" at me
> that I need to have a classic ASP page on the web
> server.
>
Yes, it does clarify, thanks. I did the .NET
newsgroup b/c [so far] I've written a pure .NET
app, but it appears I'm gonna have to have
an unmanaged piece in there.
ty

Straight ASP in VS.NET Question

All,

I have to set up a web server to handle
the following call:

<server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}

I'm pretty lightweight in ASP.NET and a pure noob
in straight ASP. What's the easiest way to set
up a simple server page to grab these three parms
and invoke a method in my managed assembly?

Thank you,
~swoozin the page_load just add some Request.QueryString() calls, maybe a simple
switch() statement.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111071784.152396.227780@.o13g2000cwo.googlegr oups.com...
> All,
> I have to set up a web server to handle
> the following call:
> <server URL>/Submit.asp?parm1={1}&parm2={2}&parm3={3}
> I'm pretty lightweight in ASP.NET and a pure noob
> in straight ASP. What's the easiest way to set
> up a simple server page to grab these three parms
> and invoke a method in my managed assembly?
> Thank you,
> ~swooz
Curt_C [MVP] wrote:
> in the page_load just add some Request.QueryString() calls, maybe a
simple
> switch() statement.
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com

Curt, thanks for the reply. I am still unsure
how to handle the "Submit.asp" in the URL. Do
I need to create a straight ASP page to handle
this? And there's the issue with ending up
in managed code with the parm values.

Thanks a lot!
~swooz
It's all yours now, Curt. -)

--

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegr oups.com...
> Curt_C [MVP] wrote:
>> in the page_load just add some Request.QueryString() calls, maybe a
> simple
>> switch() statement.
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
huh? that makes little sense to me.....
Is this .ASP or .ASPX where you are trying to read the querystring values?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111076028.221406.316920@.f14g2000cwb.googlegr oups.com...
> Curt_C [MVP] wrote:
>> in the page_load just add some Request.QueryString() calls, maybe a
> simple
>> switch() statement.
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
> Curt, thanks for the reply. I am still unsure
> how to handle the "Submit.asp" in the URL. Do
> I need to create a straight ASP page to handle
> this? And there's the issue with ending up
> in managed code with the parm values.
> Thanks a lot!
> ~swooz
I got the feeling I missed something, but thanks for the warning :}

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:eKvNk0wKFHA.2648@.TK2MSFTNGP14.phx.gbl...
> It's all yours now, Curt. -)
> --
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
> "swoozie" <swooziep@.yahoo.com> wrote in message
> news:1111076028.221406.316920@.f14g2000cwb.googlegr oups.com...
>>
>> Curt_C [MVP] wrote:
>>> in the page_load just add some Request.QueryString() calls, maybe a
>> simple
>>> switch() statement.
>>>
>>> --
>>> Curt Christianson
>>> Site & Scripts: http://www.Darkfalz.com
>>> Blog: http://blog.Darkfalz.com
>>>
>>>
>>
>> Curt, thanks for the reply. I am still unsure
>> how to handle the "Submit.asp" in the URL. Do
>> I need to create a straight ASP page to handle
>> this? And there's the issue with ending up
>> in managed code with the parm values.
>>
>> Thanks a lot!
>> ~swooz
>>
I'm sorry if I wasn't clear. The HTTP GET is from a 3rd-party
client, so I have to handle the URL with ".asp" in it (see above).
If I can handle that with ASP.NET, great! Can I set up a redirect
to an ASPX? Either way, I need to end up with the parms
in a managed assembly, be it web tier or middle. I'm fairly new
to this, so apologies in advance. And thanks so much for the help.

~swooz
One more post to further clarify! ;-)
I am assuming since they're throwing ".asp" at me
that I need to have a classic ASP page on the web
server.
you mean that THEY are pointing to YOUR site like this:

http://www.yoursite.com/submit.asp?parm1={1}&parm2={2}&parm3={3}

If so, few things...
1) wrong group, this is a .NET group.
2) you will need a page on your server called "submit.asp"
3) in that page you will need:
- myValue1 = Request.QueryString("param1")
- myValue2 = Request.QueryString("param2")
- myValue3 = Request.QueryString("param3")

that clarify it for ya?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111079290.380858.246130@.f14g2000cwb.googlegr oups.com...
> One more post to further clarify! ;-)
> I am assuming since they're throwing ".asp" at me
> that I need to have a classic ASP page on the web
> server.
Yes, it does clarify, thanks. I did the .NET
newsgroup b/c [so far] I've written a pure .NET
app, but it appears I'm gonna have to have
an unmanaged piece in there.

ty
or get them to point to a .aspx page instead

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"swoozie" <swooziep@.yahoo.com> wrote in message
news:1111080239.282185.68350@.l41g2000cwc.googlegro ups.com...
> Yes, it does clarify, thanks. I did the .NET
> newsgroup b/c [so far] I've written a pure .NET
> app, but it appears I'm gonna have to have
> an unmanaged piece in there.
> ty

Wednesday, March 28, 2012

Strange Behaviour

I have a set of aspx pages created using VSNET 2003/VB. The web site
includes a java based menu. For a specific selection I need to change the
value of a variable in a common class. I set the menu app to call a special
aspx page whose only purpose is to set the class variable and then transfer
to the main aspx page. The initial page originally had only the following
code:
========================================
====
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
CommonClass.strCallFrom = "User"
Server.Transfer("frmFindBand.aspx")
End Sub
========================================
=================
That does not work - the CommonClass.strCallFrom variable is not getting
set? Any ideas as to why this is failing?
TIA
WayneWayne,
Welcome to the web development world. Once you leave a page, it doesn't
exist anymore. Neither there is CommonClass instance, unless you took
special care to make it persistent. You should save the variable in one of a
few persistent storages, for example in a session variable.
Eliyahu
"Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
> I have a set of aspx pages created using VSNET 2003/VB. The web site
> includes a java based menu. For a specific selection I need to change the
> value of a variable in a common class. I set the menu app to call a
special
> aspx page whose only purpose is to set the class variable and then
transfer
> to the main aspx page. The initial page originally had only the following
> code:
> ========================================
====
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> CommonClass.strCallFrom = "User"
> Server.Transfer("frmFindBand.aspx")
> End Sub
> ========================================
=================
> That does not work - the CommonClass.strCallFrom variable is not getting
> set? Any ideas as to why this is failing?
>
> TIA
>
> Wayne
>
Is the strCallFrom is a static variable or instance variable? If its not
static variable, I do not see any code to instantiate the CommonClass
object?
Kumar Reddi
http://kumarreddi.blogspot.com
"Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
> I have a set of aspx pages created using VSNET 2003/VB. The web site
> includes a java based menu. For a specific selection I need to change the
> value of a variable in a common class. I set the menu app to call a
special
> aspx page whose only purpose is to set the class variable and then
transfer
> to the main aspx page. The initial page originally had only the following
> code:
> ========================================
====
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> CommonClass.strCallFrom = "User"
> Server.Transfer("frmFindBand.aspx")
> End Sub
> ========================================
=================
> That does not work - the CommonClass.strCallFrom variable is not getting
> set? Any ideas as to why this is failing?
>
> TIA
>
> Wayne
>
Note that static variables have application scope as opposed to session.
That means the two sessions while overwrite each other setting.
Eliyahu
"Kumar Reddi" <kumarreddi@.REMOVETHIS.gmail.com> wrote in message
news:%23E8uvTnIFHA.2752@.TK2MSFTNGP12.phx.gbl...
> Is the strCallFrom is a static variable or instance variable? If its not
> static variable, I do not see any code to instantiate the CommonClass
> object?
> --
> Kumar Reddi
> http://kumarreddi.blogspot.com
> "Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
> news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
the
> special
> transfer
following
>
Thanks for the replies guys but I really don't understand the need to
instance the class? If I add a button to the page and issue the transfer
from the click event, things work fine? What is different (I will readily
admit that I have a poor grasp of OO)?
Throughout the other 20+ pages I regularly set a CommonClass variable and
then use it in another page. I thought that was the whole idea of a common
class?
Any education is much appreciated.
Wayne
"Eliyahu Goldin" <removemeegoldin@.monarchmed.com> wrote in message
news:OKCW2SnIFHA.2728@.TK2MSFTNGP09.phx.gbl...
> Wayne,
> Welcome to the web development world. Once you leave a page, it doesn't
> exist anymore. Neither there is CommonClass instance, unless you took
> special care to make it persistent. You should save the variable in one of
a
> few persistent storages, for example in a session variable.
> Eliyahu
> "Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
> news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
the
> special
> transfer
following
>
You won't see a problem until there are simultaneous user's making
requests to your web application. You are using a single location to
store a piece of data for all users. Their requests will start
overwriting this single location with data for each request. Depending
on the timing user A could get user B's results or user B might get
user A's results.
It's always good to keep request state as close to the request as
possible. Don't try to take shortcuts by sticking a piece of data in a
common class and hope that when something later happens it still finds
the data there.
The Context.Items collection is a good place to store the information
you need to carry around.
Scott
http://www.OdeToCode.com/blogs/scott/
On Sun, 6 Mar 2005 11:10:53 -0700, "Wayne Wengert"
<wayneDONTWANTSPAM@.wengert.com> wrote:

>Thanks for the replies guys but I really don't understand the need to
>instance the class? If I add a button to the page and issue the transfer
>from the click event, things work fine? What is different (I will readily
>admit that I have a poor grasp of OO)?
>Throughout the other 20+ pages I regularly set a CommonClass variable and
>then use it in another page. I thought that was the whole idea of a common
>class?
>Any education is much appreciated.
>
Scott;
Thanks for the information. I think I am beginning to see my error here. The
Common Class information exists once for my application and if User A sets a
value in variable "X", any user asking for that variable will get that new
value? This was my first attempt at using a common class and I think I went
way overboard. I'll go back and change all use of the common class variables
to Session objects instead and just use the common class for constant values
like connection strings. Does that sound right?
Wayne
"Scott Allen" <scott@.nospam.odetocode.com> wrote in message
news:f7lm21phif382dg7fl45ee4rfrdpktgn8f@.
4ax.com...
> You won't see a problem until there are simultaneous user's making
> requests to your web application. You are using a single location to
> store a piece of data for all users. Their requests will start
> overwriting this single location with data for each request. Depending
> on the timing user A could get user B's results or user B might get
> user A's results.
> It's always good to keep request state as close to the request as
> possible. Don't try to take shortcuts by sticking a piece of data in a
> common class and hope that when something later happens it still finds
> the data there.
> The Context.Items collection is a good place to store the information
> you need to carry around.
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
> On Sun, 6 Mar 2005 11:10:53 -0700, "Wayne Wengert"
> <wayneDONTWANTSPAM@.wengert.com> wrote:
>
common
>
Hi Wayne:
Yes, that's what can happen with Shared fields in VB.NET.
Like I say, Context.Items can be just as useful as Session if you need
information to stick around during a Server.Transfer
Scott
http://www.OdeToCode.com/blogs/scott/
On Sun, 6 Mar 2005 13:58:41 -0700, "Wayne Wengert"
<wayneDONTWANTSPAM@.wengert.com> wrote:

>Scott;
>Thanks for the information. I think I am beginning to see my error here. Th
e
>Common Class information exists once for my application and if User A sets
a
>value in variable "X", any user asking for that variable will get that new
>value? This was my first attempt at using a common class and I think I went
>way overboard. I'll go back and change all use of the common class variable
s
>to Session objects instead and just use the common class for constant value
s
>like connection strings. Does that sound right?
>Wayne
>

Strange Behaviour

I have a set of aspx pages created using VSNET 2003/VB. The web site
includes a java based menu. For a specific selection I need to change the
value of a variable in a common class. I set the menu app to call a special
aspx page whose only purpose is to set the class variable and then transfer
to the main aspx page. The initial page originally had only the following
code:
============================================
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
CommonClass.strCallFrom = "User"

Server.Transfer("frmFindBand.aspx")

End Sub

================================================== =======

That does not work - the CommonClass.strCallFrom variable is not getting
set? Any ideas as to why this is failing?

TIA

WayneWayne,

Welcome to the web development world. Once you leave a page, it doesn't
exist anymore. Neither there is CommonClass instance, unless you took
special care to make it persistent. You should save the variable in one of a
few persistent storages, for example in a session variable.

Eliyahu

"Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
> I have a set of aspx pages created using VSNET 2003/VB. The web site
> includes a java based menu. For a specific selection I need to change the
> value of a variable in a common class. I set the menu app to call a
special
> aspx page whose only purpose is to set the class variable and then
transfer
> to the main aspx page. The initial page originally had only the following
> code:
> ============================================
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> CommonClass.strCallFrom = "User"
> Server.Transfer("frmFindBand.aspx")
> End Sub
> ================================================== =======
> That does not work - the CommonClass.strCallFrom variable is not getting
> set? Any ideas as to why this is failing?
>
> TIA
>
> Wayne
Is the strCallFrom is a static variable or instance variable? If its not
static variable, I do not see any code to instantiate the CommonClass
object?

--
Kumar Reddi
http://kumarreddi.blogspot.com

"Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
> I have a set of aspx pages created using VSNET 2003/VB. The web site
> includes a java based menu. For a specific selection I need to change the
> value of a variable in a common class. I set the menu app to call a
special
> aspx page whose only purpose is to set the class variable and then
transfer
> to the main aspx page. The initial page originally had only the following
> code:
> ============================================
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> CommonClass.strCallFrom = "User"
> Server.Transfer("frmFindBand.aspx")
> End Sub
> ================================================== =======
> That does not work - the CommonClass.strCallFrom variable is not getting
> set? Any ideas as to why this is failing?
>
> TIA
>
> Wayne
Note that static variables have application scope as opposed to session.
That means the two sessions while overwrite each other setting.

Eliyahu

"Kumar Reddi" <kumarreddi@.REMOVETHIS.gmail.com> wrote in message
news:%23E8uvTnIFHA.2752@.TK2MSFTNGP12.phx.gbl...
> Is the strCallFrom is a static variable or instance variable? If its not
> static variable, I do not see any code to instantiate the CommonClass
> object?
> --
> Kumar Reddi
> http://kumarreddi.blogspot.com
> "Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
> news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
> > I have a set of aspx pages created using VSNET 2003/VB. The web site
> > includes a java based menu. For a specific selection I need to change
the
> > value of a variable in a common class. I set the menu app to call a
> special
> > aspx page whose only purpose is to set the class variable and then
> transfer
> > to the main aspx page. The initial page originally had only the
following
> > code:
> > ============================================
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > CommonClass.strCallFrom = "User"
> > Server.Transfer("frmFindBand.aspx")
> > End Sub
> > ================================================== =======
> > That does not work - the CommonClass.strCallFrom variable is not getting
> > set? Any ideas as to why this is failing?
> > TIA
> > Wayne
Thanks for the replies guys but I really don't understand the need to
instance the class? If I add a button to the page and issue the transfer
from the click event, things work fine? What is different (I will readily
admit that I have a poor grasp of OO)?

Throughout the other 20+ pages I regularly set a CommonClass variable and
then use it in another page. I thought that was the whole idea of a common
class?

Any education is much appreciated.

Wayne

"Eliyahu Goldin" <removemeegoldin@.monarchmed.com> wrote in message
news:OKCW2SnIFHA.2728@.TK2MSFTNGP09.phx.gbl...
> Wayne,
> Welcome to the web development world. Once you leave a page, it doesn't
> exist anymore. Neither there is CommonClass instance, unless you took
> special care to make it persistent. You should save the variable in one of
a
> few persistent storages, for example in a session variable.
> Eliyahu
> "Wayne Wengert" <wayneDONTWANTSPAM@.wengert.com> wrote in message
> news:usT4CLmIFHA.588@.TK2MSFTNGP15.phx.gbl...
> > I have a set of aspx pages created using VSNET 2003/VB. The web site
> > includes a java based menu. For a specific selection I need to change
the
> > value of a variable in a common class. I set the menu app to call a
> special
> > aspx page whose only purpose is to set the class variable and then
> transfer
> > to the main aspx page. The initial page originally had only the
following
> > code:
> > ============================================
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > CommonClass.strCallFrom = "User"
> > Server.Transfer("frmFindBand.aspx")
> > End Sub
> > ================================================== =======
> > That does not work - the CommonClass.strCallFrom variable is not getting
> > set? Any ideas as to why this is failing?
> > TIA
> > Wayne
You won't see a problem until there are simultaneous user's making
requests to your web application. You are using a single location to
store a piece of data for all users. Their requests will start
overwriting this single location with data for each request. Depending
on the timing user A could get user B's results or user B might get
user A's results.

It's always good to keep request state as close to the request as
possible. Don't try to take shortcuts by sticking a piece of data in a
common class and hope that when something later happens it still finds
the data there.

The Context.Items collection is a good place to store the information
you need to carry around.

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

On Sun, 6 Mar 2005 11:10:53 -0700, "Wayne Wengert"
<wayneDONTWANTSPAM@.wengert.com> wrote:

>Thanks for the replies guys but I really don't understand the need to
>instance the class? If I add a button to the page and issue the transfer
>from the click event, things work fine? What is different (I will readily
>admit that I have a poor grasp of OO)?
>Throughout the other 20+ pages I regularly set a CommonClass variable and
>then use it in another page. I thought that was the whole idea of a common
>class?
>Any education is much appreciated.
Scott;

Thanks for the information. I think I am beginning to see my error here. The
Common Class information exists once for my application and if User A sets a
value in variable "X", any user asking for that variable will get that new
value? This was my first attempt at using a common class and I think I went
way overboard. I'll go back and change all use of the common class variables
to Session objects instead and just use the common class for constant values
like connection strings. Does that sound right?

Wayne

"Scott Allen" <scott@.nospam.odetocode.com> wrote in message
news:f7lm21phif382dg7fl45ee4rfrdpktgn8f@.4ax.com...
> You won't see a problem until there are simultaneous user's making
> requests to your web application. You are using a single location to
> store a piece of data for all users. Their requests will start
> overwriting this single location with data for each request. Depending
> on the timing user A could get user B's results or user B might get
> user A's results.
> It's always good to keep request state as close to the request as
> possible. Don't try to take shortcuts by sticking a piece of data in a
> common class and hope that when something later happens it still finds
> the data there.
> The Context.Items collection is a good place to store the information
> you need to carry around.
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
> On Sun, 6 Mar 2005 11:10:53 -0700, "Wayne Wengert"
> <wayneDONTWANTSPAM@.wengert.com> wrote:
> >Thanks for the replies guys but I really don't understand the need to
> >instance the class? If I add a button to the page and issue the transfer
> >from the click event, things work fine? What is different (I will readily
> >admit that I have a poor grasp of OO)?
> >Throughout the other 20+ pages I regularly set a CommonClass variable and
> >then use it in another page. I thought that was the whole idea of a
common
> >class?
> >Any education is much appreciated.
Hi Wayne:

Yes, that's what can happen with Shared fields in VB.NET.

Like I say, Context.Items can be just as useful as Session if you need
information to stick around during a Server.Transfer

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

On Sun, 6 Mar 2005 13:58:41 -0700, "Wayne Wengert"
<wayneDONTWANTSPAM@.wengert.com> wrote:

>Scott;
>Thanks for the information. I think I am beginning to see my error here. The
>Common Class information exists once for my application and if User A sets a
>value in variable "X", any user asking for that variable will get that new
>value? This was my first attempt at using a common class and I think I went
>way overboard. I'll go back and change all use of the common class variables
>to Session objects instead and just use the common class for constant values
>like connection strings. Does that sound right?
>Wayne