Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cross Page Post Back When Using Mixture of Master Pages and Non-Master Pages

Reply
Thread Tools

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

 
 
Jason@webbit.com
Guest
Posts: n/a
 
      05-16-2006
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?

 
Reply With Quote
 
 
 
 
PeterKellner
Guest
Posts: n/a
 
      05-16-2006
On 16 May 2006 04:46:12 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clarification on the applicability of compile-time optimization to astruct variable which encompasses a mixture of fields declared as volatileand non-volatile individually Myth__Buster C Programming 45 07-15-2012 04:46 AM
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
2nd Post: VB Master-Details Edit (Separate Pages), Response Redirect to Master Page Databinding Issue... Sam ASP .Net 1 07-20-2006 06:17 PM
wired / wireless network mixture or not ? ReceT Wireless Networking 3 07-12-2004 02:54 AM
gaussian mixture? GBartgo C++ 2 11-02-2003 12:10 AM



Advertisments