Wednesday, March 21, 2012

PassingObjectstoWebForms

I have an object that gets created when the first ASP.NET webform, of
the web app, is opened. I need to pass this object to other webforms as
they are opened and keep the scope in the same session. How can I do this?

ThanksHI J,

You can store the object into a Session var and pick it up in following
forms. This works well assuming that the object you are storing is
serializable.

If you're using Server.Transfer() or Server.Excute() you can also use
Context.Items() to store request specific info to pass to transferred pages.

+++ Rick --

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
-----------
Making waves on the Web

"J" <j@.netscape.net> wrote in message
news:ODlq6J5AEHA.3400@.tk2msftngp13.phx.gbl...
> I have an object that gets created when the first ASP.NET webform, of
> the web app, is opened. I need to pass this object to other webforms as
> they are opened and keep the scope in the same session. How can I do
this?
> Thanks

0 comments:

Post a Comment