Solved

posting forms to another page?

Posted on 2002-07-22
3
227 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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