keyongtech


  keyongtech > dotnet.framework.aspnet.* > dotnet.framework.aspnet.main > 05/2006

 #1  
05-16-06, 12:46 PM
Jason
I have page1.aspx that a user enters data in some form fields.
Page1.aspx's form fields are placed within a Content Place Holder on
the page and the page is using a Master Page. Page1.aspx posts to
Page2.aspx, which doesn't use a Master Page at all - it's just a
straight forward .aspx page. Problem is I can't seem to get the form
field values from page1.aspx in use on page2.aspx. I've set up the
PagePostBackURL attribute on the submit button on page1.aspx and have
added the PreviousPageType directive along with the virtualpath
attribute of it to page2.aspx. Help. How do I get the posted values
from the first page?
 #2  
05-16-06, 03:00 PM
PeterKellner
On 16 May 2006 04:46:12 -0700, Jason wrote:

>I have page1.aspx that a user enters data in some form fields.
>Page1.aspx's form fields are placed within a Content Place Holder on
>the page and the page is using a Master Page. Page1.aspx posts to
>Page2.aspx, which doesn't use a Master Page at all - it's just a
>straight forward .aspx page. Problem is I can't seem to get the form
>field values from page1.aspx in use on page2.aspx. I've set up the
>PagePostBackURL attribute on the submit button on page1.aspx and have
>added the PreviousPageType directive along with the virtualpath
>attribute of it to page2.aspx. Help. How do I get the posted values
>from the first page?


I think you say you are pulling from a page that "has" a masterpage?
If so, you need to reference the real control name which you can find
by turning on trace in the page header.

(Trace="true")

Then, after you have the real field name, you can do something like
this:

Default sourcePage = (Default)PreviousPage;

TextBox textBoxTargetWeight =
sourcePage.FindControl("ctl00$ContentPlaceHolder1$ TextBoxTargetWeight")
as TextBox;

Don't forget (like I did) the reference to your Default class in the
Previous Page like this:

<%@ PreviousPageType VirtualPath="~/Default.aspx" %>

Good Luck,

Peter Kellner
http://peterkellner.net
Peter Kellner
http://peterkellner.net
Similar Threads
Master Pages vs. Master .DWT files in Expression Web Designer

Here is my first hurdle. I understand the differences well enough I think between Visual Web Developer 2005 Express and CTP of Expression Web Designer. I love the later by...

2nd Post: VB Master-Details Edit (Separate Pages), Response Redirect to Master Page Databinding Issue...

Attached I am sending 2 URL's from MSFT ASP.net Quick Start Tutorial Web Site. 1) Run it URL: [..]... 2) View Source URL: [..]...

MS Publisher: How to change master pages w/o opening the master?

I have numerous different master pages that work in all of my documents. I would like to change master pages in a document without having to open the master page. Is there...

Master Pages and Cross-Page Form Information

I'm slowly learning the new caveats of master pages and ASP.NET 2.0 and, so far, really enjoying it. A couple of questions to help kickstart my mind from the old ASP3 days. ...

Master Pages Great! But what about Master User Controls?

>From ASP.NET 1.1 I have a very useful UserControl which acts like a template control. I call it a CustomTemplate. Basically it gives me a re-usable look to sections of the...


All times are GMT. The time now is 01:35 PM. | Privacy Policy