473,770 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cross Page posting problems asp.net 2.0

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.Co ntrols)
{
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

Nov 19 '05 #1
5 1446
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.Co ntrols)
{
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

Nov 19 '05 #2
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_da rkfalz.com> wrote in message
news:97******** *************** ***********@mic rosoft.com...
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.Co ntrols)
{
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

Nov 19 '05 #3
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.We bParts[0];
UserControl uc = hw.FindControl( "HelloWorld 1") 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" <Br*****@nospam .nospam>
| References: <#M************ **@tk2msftngp13 .phx.gbl>
<97************ *************** *******@microso ft.com>
| 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: <Ou************ *@tk2msftngp13. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 208-46-205-150.dia.cust.qw est.net 208.46.205.150
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1328 42
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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_da rkfalz.com> wrote in message
| news:97******** *************** ***********@mic rosoft.com...
| > 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.Co ntrols)
| >> {
| >> 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
| >>
| >>
| >>
| >>
|
|
|

Nov 19 '05 #4
Stephen suggestion is good. I also have some additional information
that shows how to use the strongly typed PreviousPage:

http://odetocode.com/Articles/421.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #5
Hi Bryan,

How are you doing on this issue, does the suggestion in my last reply helps
a little? If there're anything else we can help, please feel free to post
here.

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: Scott Allen <sc***@nospam.o detocode.com>
| Subject: Re: Cross Page posting problems asp.net 2.0
| Date: Fri, 21 Oct 2005 09:07:02 -0400
| Message-ID: <tt************ *************** *****@4ax.com>
| References: <#M************ **@tk2msftngp13 .phx.gbl>
<97************ *************** *******@microso ft.com>
<Ou************ *@tk2msftngp13. phx.gbl>
<U4************ **@TK2MSFTNGXA0 1.phx.gbl>
| X-Newsreader: Forte Agent 1.8/32.548
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: dyn-170-243-160.myactv.net 24.170.243.160
| Lines: 1
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1330 06
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Stephen suggestion is good. I also have some additional information
| that shows how to use the strongly typed PreviousPage:
|
| http://odetocode.com/Articles/421.aspx
|
| --
| Scott
| http://www.OdeToCode.com/blogs/scott/
|
|
|

Nov 19 '05 #6

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

Similar topics

7
1962
by: Venkat | last post by:
Hi All, I would like to about Cross Site Scripting. I googled XSS and got the point what it is but didn't get how it is achieved. Can someone describe me with an example how an hacker does it. My intension is not to hack anything but i am preparing a presentation on this and would like to caution my team mates about the consequences of XSS and how to protect our web based applications from a possible attack.
2
2271
by: Peter Bär | last post by:
A Question to the C#/.Net Gods of this forum: are there performance penalties when i compile (C#, FW1.1, ASP.NET, Studio2003) a central baseclass in a different assembly than all the derived classes? f.i. ive got a class dbobject i project "Basesupport", compiles to Basesupport.dll. From dbobject i derive about 100 classes, thy all are located in Project
7
3914
by: Scott M. | last post by:
How can I disable the cross-site scripting check for one particular page of a site?
10
4918
by: Atul Bahl | last post by:
I am not able to reference values by using cross page postings when using master page. Currently I am runing on beta 2 of CLR. Any ideas... Thanks Atul
6
1526
by: Andrew | last post by:
Hello, friends, I tried to do cross-page posting, i.e., in firstpage.aspx I used action="secondpage.aspx". Since I am using asp.net 1.1, so it always goes back to firstpage.aspx aftern submitting firstpage.aspx. I then tried in page_load of firstpage.aspx:
28
1957
by: Ian Davies | last post by:
Hello I would appreciate some help from someone who has knowledge of working with css, php javascript and how they interact. Ive been working on a task for the last few days and have started to hit a brick wall. I need general advice on whether I m tackling the problem the correct way and some solutions for my current problems Ive posted my project below where ive detailed the current problems im having...
0
1128
by: Jason Wilson | last post by:
I have two pages that that cross post to each other: Page1 has a form Page2 verifies the form entries before posting to a DB If the user sees problems with their entries they can click an Edit button that will send them back to Page1. When I click the edit button on page2 I get a runtime error as it tries to evaluate the page2 Page_Load.
2
1236
by: Vu Truong | last post by:
Hello, I try to use PostBackUrl to cross post between 2 pages on difference application. At the first time, I press the button on source page. Check on target page, I see Request.Form is nothing and Request.HttpMethod is GET (not POST). But if I don't close the browser, try to enter the URL of source page and press the button on source page again, I see, on target page, Request.Form is source page and Request.HttpMethod is POST. I try...
2
1833
by: deshg | last post by:
Hey everyone, I am a php programmer originally and am just helping a friend of mine update their website that they paid a designer (well that's what he called himself!) to do ages ago. I have built the whole site (ASP.NET using VB.NET) but am having problems on the most basic thing! I have a page which querys an MS SQL database and takes url variables to query it, so it takes the value of keyword= and perpage= (eg from...
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.