473,748 Members | 2,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cross page posting and viewstate question


Hi

I'd like to post a page to another page using LinkButton.Post BackUrl. 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
Jun 13 '07 #1
2 2269
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/PaulW...ult.aspx?id=10

Couldn't you just put them on the same page and switch the display with
Panels or MultiView?
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"J055" <j0**@newsgroup s.nospamwrote in message
news:eE******** ******@TK2MSFTN GP06.phx.gbl...
>
Hi

I'd like to post a page to another page using LinkButton.Post BackUrl. 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

Jun 13 '07 #2
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
Jun 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4332
by: Magnus | last post by:
Hi! This is my problem: I want to go from page1 to page2, and to get all the form variables from page1 to page2. I have turned the viewstate and the sessionstate off, and i really just want to get these variables the
3
2192
by: Gvnn | last post by:
Hi, I've a little problem, i've an asp.net page, with a runat server form, like this: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="index.aspx.vb" Inherits="indexGstPro"%> <HTML> <HEAD> </HEAD> <body>
4
2804
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than one runat=server form on a asp.net page. However, I still want developers to be able to use asp.net controls to create some apps that are created on the page. So I need multiple forms on a asp.net page(doesn't everyone). I purchased the...
2
783
by: Brad | last post by:
I have an intranet app that has just started sporadically getting the following error "The viewstate is invalid for this page and might be corrupted." By sproadic I mean 3-4 times during the past two days out of 100's of hits. The error just started yesterday and this app has been running for quite some time without this error and has not been updated just before or after the error started. Reseaching this error I've checked the...
6
6017
by: Glenn Owens | last post by:
I have an ASP.Net page on which there are serveral static controls (listboxes, radiobuttonlist and textboxes). These controls are used to create criteria from which the code-behind will dynamically create 1-n datagrids. When the Submit button is clicked I need to save (in viewstate) the contents of the criteria controls so that I can recreate the dynamic DataGrid(s) in the LoadViewState (overloaded method). I need to do this so that the...
3
3687
by: Kevin Gorski | last post by:
This question has been asked before, but there have been no definitive answers that I was able to find. Can the viewstate hidden input field be moved to a less prominent page location? On an otherwise well-optimised page a large viewstate can be detrimental to it's page-ranking since the content is pushed further from the beginning of the document. Thanks for any help.
12
3125
by: Rudy | last post by:
Hi, I need to make a request to a asp.net page using HttpWebRequest class and I need to trick this page into thinking it's a postback and a button was clicked. But the page doesn't handle the click event, despite I'm using "POST" method and sending all the form fields (except of __VIEWSTATE, may this be the reason ?). So the question is: on what basis does asp.net page set the ispostback property to true or false?
6
5831
by: bill | last post by:
Is there a way to retrieve values from the viewstate in the previouspage using cross page postback? Thanks! Bill
0
2275
by: sowmyavsh | last post by:
Below is my asp.net code which should fetch the correct answer from the xml document. how can i store the xml attribute (i.e to an object or string)? it is throwing an error object reference not set to the instance of the object could any one help me <?xml version="1.0" encoding="utf-8" ?> <quiz> <mchoice> <question>Which of the following characteristics distinguishes man from the other animals </question> <answer>Ability to stand erect...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.