Hi Bryan,
As for your scenario, the Previous Page's control hierarchy is very
complex, I'd suggest that we first define a public property in the previous
page's page class to expose that certain inner control. for example:
================
public Label InnerLabel
{
get
{
WebPart hw = WebPartZone1.WebParts[0];
UserControl uc = hw.FindControl("HelloWorld1") as UserControl;
Label lbl = uc.FindControl("lblMessage") as Label;
return lbl ;
}
}
==================
then, you can access this propety in the perviouspage instance (through
reflection or strong typed instance) in the target post page's code.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bryan" <
[email protected]>
| References: <#
[email protected]>
<
[email protected]>
| Subject: Re: Cross Page posting problems asp.net 2.0
| Date: Thu, 20 Oct 2005 11:55:59 -0700
| Lines: 49
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 208-46-205-150.dia.cust.qwest.net 208.46.205.150
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:132842
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| True, but I was just trying to use the new functionality in 2.0.
|
| If anyone can help using cross page posting using 2.0 that would be great!
|
| Thanks!
| Bryan
|
|
| "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
| | > store the value in the page postback (session, db, etc) and then read
it
| > in
| > on page2.
| > --
| > Curt Christianson
| > site:
http://www.darkfalz.com
| > blog:
http://blog.darkfalz.com
| >
| >
| >
| > "Bryan" wrote:
| >
| >> I am trying to get to a label control to get its Text value. from a
| >> previous
| >> page.
| >>
| >> The label control is buried in a Web User Control that is in a
webpart
| >> zone. When I use this code:
| >> foreach(Control c in PreviousPage.Controls)
| >> {
| >> and try to find the control here.
| >>
| >> }
| >>
| >> I can only see the masterpage, then another loop inside that gets me
some
| >> literal controls etc.
| >>
| >> I cannot even find the Web Part Zone! Please help, is there an easier
way
| >> to
| >> do this?
| >>
| >> Thanks,
| >> Bryan
| >>
| >>
| >>
| >>
|
|
|