473,288 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Cross Page Post Back When Using Mixture of Master Pages and Non-Master Pages

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?

May 16 '06 #1
1 1884
On 16 May 2006 04:46:12 -0700, Ja***@webbit.com 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
May 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Dave Smithz | last post by:
Hi, In summary: I want to a form to submit information via a HTTP POST, however, when using Internet Explorer I want to be able to use the back button and all the information retained....
1
by: bigmac | last post by:
Hi - I have what I think is a "simple problem". We currently have a database table that stores ItemProperties by ItemID, PropertyID and Value. (The PropertyID references another table for...
22
by: Trammel | last post by:
Hi, I am here to request support from anyone that has idea's on cross-browser HTML (Mainly Firefox and IE). My personal website http://trammel.no-ip.info works fine on Firefox but IE decides to...
23
by: Jeff Rodriguez | last post by:
Here's what I want do: Have a main daemon which starts up several threads in a Boss-Queue structure. From those threads, I want them all to sit and watch a queue. Once an entry goes into the...
0
by: Martin | last post by:
Hi, In the scenario described by Scott Allen at http://odetocode.com/Articles/421.aspx, he points out the issue of handling server side validation failing on the source page of a cross page post...
1
by: Brian D | last post by:
Take a look at this page. http://tempsite.texwipe.com/test/ The code is too long to post here so just look at the source. It works flawlessly in IE, but in Firefox not so much. Here is the...
4
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I need to post a form to an alternate technology. I have created pop up windows that on post back will open a new window, but this uses get. I need to encode variables and POST to a new window on...
2
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm reying to get around the problem of cross page post back. I'm attempting to use an interface to cast the previous page. if (PreviousPage != null) { ICommonPostback frm = PreviousPage as...
42
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
I'm currently writing a program and I've got in mind to keep it as portable as possible. In particular I want it to run on Linux and Windows, but I'm also keeping an open mind to any machine that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.