Cross page posting and viewstate question

J

J055

Hi

I'd like to post a page to another page using LinkButton.PostBackUrl. Then
using another LinkButton on the target page post back to the source page and
restore the controls to the state they were in before the first post to the
target.

Is there an easy way to do this? Perhaps I should consider another approach?

Many thanks
Andrew
 
T

Teemu Keiski

Not an easy way, unless they are databound controls and you have state
somwhere in session and ready for redatabinding. Another trick is to save
viewstate to session and use a hack to make the page think it's a postback
and therefor load state from session as if it's loaded from viewstate on
postback, but it's not the easiest thing.

http://authors.aspalliance.com/PaulWilson/Articles/Default.aspx?id=10

Couldn't you just put them on the same page and switch the display with
Panels or MultiView?
 
J

J055

Hi Teemu

Thanks for the tip. I hadn't really looked into cross page posting until now
so wasn't sure if it was useful for my requirements. I've used your approach
of using controls on the same page, hiding and unhiding them as necessary,
which is a lot neater and works fine now.

Many thanks
Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top