Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing objects between pages 1

Status
Not open for further replies.

wawalter

Programmer
Aug 2, 2001
125
US
Hello,

I need to pass an object from one page to a recieving page and then pass it back to the original page after the object is altered by the user.

I found a couple examples using Server.Transfer and either a hidden control or using the viewstate, but the examples either don't work (at least for me) or I'm having trouble sorting through all the surrounding code that doesn't have anything to do with the process I want.

I am using C# and .Net 2.0. Thanks for any assistance.

Bill
 
How about a Session variable?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Try this it might help:-
In the calling page do the folling(control1 and control2 are textboxes here):-

Context.Items[mycontrol1] = mycontrol1.Text
Server.Transfer("uri", true);

In the called page do:-

Page callingpagename = (Page)Context.Handler;
mycontrol2=(expicit conversion)callingpagename.FindControl("mycontrol1").Text
 
I can't use session variables because of something to do with our webfarm.

I basically ended up using codeing's code and serialized my object putting it into a hidden control then grabbing the hidden control from the next page and deserializing it.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top