Solved

posting forms to another page?

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now