Wrox Programmer Forums
|
BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
This is the forum to discuss the Wrox book Professional ASP.NET 3.5: In C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470187579
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2008, 10:12 AM
Authorized User
 
Join Date: Jun 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cross-Page Posting

I have tried a simplified version of cross-page posting based on listings 1-9 and 1-10 (pp. 27-29). I had one text box on each page, and a button in the first. In the first document I also had a hyperlink to the second page.

Two things happened that I found surprising.

(1) The second page displaced the first page from the browser as soon as the data were transferred.

(2) When I returned to the first page and clicked on the hyperlink to the second, I got an error message, of which the following is an extract:

"Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 16: protected void Page_Load(object sender, EventArgs e)
Line 17: {
Line 18: TextBox pp_TextBox1 = (TextBox)PreviousPage.FindControl("TextBox1");
Line 19: TextBox1.Text = pp_TextBox1.Text;
Line 20: }"

This code is from the second page. Each text box is called "TextBox1" in its own page.

Is there any way I can prevent either of these behaviors from happening?

Thank you for your trouble.

Roman
 
Old June 25th, 2008, 10:25 AM
Authorized User
 
Join Date: Jun 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oops! I think the answer, or at least sufficient of it, is given in the last paragraph of page 31. Sorry!






Similar Threads
Thread Thread Starter Forum Replies Last Post
cross-page posting within pages with master file.. poogles ASP.NET 2.0 Basics 2 August 6th, 2007 05:11 AM
Posting String Array From one page to another page Samatha ASP.NET 1.0 and 1.1 Professional 1 December 6th, 2006 03:54 AM
Page is posting to itself parypoo ASP.NET 1.0 and 1.1 Professional 2 April 17th, 2006 06:08 AM
Page Not Posting RGB ASP.NET 1.0 and 1.1 Basics 11 March 7th, 2006 01:58 PM
cross-page posting macupryk Visual Studio 2005 0 December 17th, 2004 06:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.