Solved

posting forms to another page?

Posted on 2002-07-22
3
228 Views
Last Modified: 2010-04-15
is there a quick method of being able to retrieve form values if i post it to another page?

if I use on my submit button of Page1.aspx:
Server.Transfer("Page2.aspx", true);

I get a ViewState not found error on Page2.aspx.  

I understand this error, but cannot figure out a workaround,

I've tried making  all of the controls on Page1 public, then on Page2 doing this:

Page1 Pg1 = new Page1();
Response.Write(Pg1.Text1.Text.ToString());

Intellisense finds the controls, however, when I run this code, it tells me object reference not set to an instance of an object?

any help?

Thanks,

Sean
0
Comment
Question by:SeanGraflund
3 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 7170375
don't try to treat the webforms as you would a winform - Any informtaion that you wish to pass between forms could be passed via the Session object - not very OO I'll admit
0
 

Accepted Solution

by:
chrisdedels earned 50 total points
ID: 7172934
Sean,

Try this link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskPassingValuesBetweenWebFormsPages.asp

It should be of some help.  In addition, you will also need the following reference in the HTML of your destination page:

<%@ Reference Page="originatingpage.aspx" %>

Chris
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 9505100
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept a comment by chrisdedels
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheAvenger
EE Cleanup Volunteer
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question