Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 March 7th, 2005, 04:34 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Posting data from Control to Page


I'm trying to post data from a user control to a page. I can access the data sure enough, but the problem I am now having is the fields are blank. I can't retrieve any of the fields defined in the user control in the posted to page. To give you a scenario, I have two pages search.aspx and view.aspx, which both post to searchresults.aspx. view.aspx has a user control that posts the user control data to searchresults.aspx page using PostBackUrl.

So it posts back to the page fine, but IsCrossPagePosted is false and there isn't any fields in the control.

Any ideas? Thanks,

Old December 6th, 2005, 08:08 PM
Registered User
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Whenever you have controls within a User Control, you should remember to traverse the control hierarchy properly to access the controls. You may have to do something like this:

((TextBox)Page.PreviousPage.FindControl("MyUserCon trol").FindControl("EmbeddedTextBoxControl)).Text

Similar Threads
Thread Thread Starter Forum Replies Last Post
Posting a page from AJAX Tab Control dhurjati_sen C# 2 August 20th, 2007 11:05 PM
Posting to Another Page & reading data posted geo54321 C# 1 February 19th, 2007 12:22 PM
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
More Qstn on posting"Create Control on the fly" lxu Access 0 April 14th, 2004 09:10 AM
posting/requesting data from web server page one5 .NET Web Services 2 July 28th, 2003 03:14 PM

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