Web forms are not designed for passing strongly typed data to each
other and certainly are not meant for one web form to call properties
in another form. HTTP pages have two well defined ways of passing
data--query string and form variables.
If the data you're passing is more complex than a string, then create
a class to contain the data and put that class in the
HttpContext.Curent.Items collection when passing it, and then cast it
on the receiving page back to the typed class.
Using Session is horrible because the data is not inherintly session
related--you're just passing it from one page to another and dumping
it into the Session is overkill and dangerous).
My $0.02.
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On Wed, 7 Feb 2007 15:11:52 -0500, "Chad"
<ch**************@unisys.comwrote:
>Interesting point of view, my perspective was the exact opposite: that
passing values from one form to another using strongly type full-blown
properties (which themseleves could have code in the Get routine) is much
more elegant and preferable method to passing string data via hidden forms
fields or even the Session object, which often ends up being a dumping
ground for all of the pages in the app.
I want to be able to defined a property on the source web page that returns
an object that contains all of the property values that are passed from the
source form to the dest form and to do so in a strongly typed "Parameter
class" that is specific to the two forms in question only.
"Samuel R. Neff" <sa********@nomail.comwrote in message
news:bj********************************@4ax.com.. .
>>
Peter's post about using query string or HttpContext.Current.Items is
probably the best advice. Passing data between webforms by relying on
the webforms own properties is pretty ugly, even if it technically
works.
HTH,
Sam