Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 25th, 2008, 10:12 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
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
  #2 (permalink)  
Old June 25th, 2008, 10:25 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
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!

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.