473,414 Members | 1,663 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,414 software developers and data experts.

Parent page name (Usercontrol)

Hi, is it possible for a UserControl to get the Page name and querystring of
its parent?

e.g If a userControl is inside a page called "index.aspx?ID=66" how can a
usercontrol print out this value? I was hoping there might be a
Parent.PageName or Parent.Querystring method :)

Thanks in advance
John

Nov 18 '05 #1
4 10867

Page.Request["ID"]

-Oleg.

"John" <JD@noSpam.com> wrote in message news:ca**********@lust.ihug.co.nz...
Hi, is it possible for a UserControl to get the Page name and querystring of its parent?

e.g If a userControl is inside a page called "index.aspx?ID=66" how can a
usercontrol print out this value? I was hoping there might be a
Parent.PageName or Parent.Querystring method :)

Thanks in advance
John


Nov 18 '05 #2
Hi Oleg, thanks for that. I actually wanted to print out the whole string
including the page name

e.g

if the usercontrol is contained in a page called index.aspx
and the page index.aspx has a querystring of ?ID=66666

then I want the usercontrol to print both the container page name
(index.aspx in this case) as well as the querystring (?ID=66666) as given in
the above example

thanks again
Mark

--

"Oleg Ogurok" <ol**@ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:10*************@corp.supernews.com...

Page.Request["ID"]

-Oleg.

"John" <JD@noSpam.com> wrote in message news:ca**********@lust.ihug.co.nz...
Hi, is it possible for a UserControl to get the Page name and querystring of
its parent?

e.g If a userControl is inside a page called "index.aspx?ID=66" how can

a usercontrol print out this value? I was hoping there might be a
Parent.PageName or Parent.Querystring method :)

Thanks in advance
John



Nov 18 '05 #3
Use Page.Request.RawUrl

Some documentation:

The raw URL is defined as the part of the URL following the domain
information. In the URL string http://www.contoso.com/articles/recent.aspx,
the raw URL is/articles/recent.aspx. The raw URL includes the query string,
if present.
kind regards,
henrik

"John" <JD@noSpam.com> schreef in bericht
news:ca**********@lust.ihug.co.nz...
Hi Oleg, thanks for that. I actually wanted to print out the whole string
including the page name

e.g

if the usercontrol is contained in a page called index.aspx
and the page index.aspx has a querystring of ?ID=66666

then I want the usercontrol to print both the container page name
(index.aspx in this case) as well as the querystring (?ID=66666) as given in the above example

thanks again
Mark

--

"Oleg Ogurok" <ol**@ogurok.com.ihatespammers.ireallydo.co> wrote in message news:10*************@corp.supernews.com...

Page.Request["ID"]

-Oleg.

"John" <JD@noSpam.com> wrote in message news:ca**********@lust.ihug.co.nz...
Hi, is it possible for a UserControl to get the Page name and querystring
of
its parent?

e.g If a userControl is inside a page called "index.aspx?ID=66" how

can a usercontrol print out this value? I was hoping there might be a
Parent.PageName or Parent.Querystring method :)

Thanks in advance
John




Nov 18 '05 #4
Cool, thanks for that :)
Cheers
Mark
"Henrik de Jong" <nn@nnnnnn.nl> wrote in message
news:#o**************@TK2MSFTNGP09.phx.gbl...
Use Page.Request.RawUrl

Some documentation:

The raw URL is defined as the part of the URL following the domain
information. In the URL string http://www.contoso.com/articles/recent.aspx, the raw URL is/articles/recent.aspx. The raw URL includes the query string, if present.
kind regards,
henrik

"John" <JD@noSpam.com> schreef in bericht
news:ca**********@lust.ihug.co.nz...
Hi Oleg, thanks for that. I actually wanted to print out the whole string including the page name

e.g

if the usercontrol is contained in a page called index.aspx
and the page index.aspx has a querystring of ?ID=66666

then I want the usercontrol to print both the container page name
(index.aspx in this case) as well as the querystring (?ID=66666) as
given in
the above example

thanks again
Mark

--

"Oleg Ogurok" <ol**@ogurok.com.ihatespammers.ireallydo.co> wrote in

message
news:10*************@corp.supernews.com...

Page.Request["ID"]

-Oleg.

"John" <JD@noSpam.com> wrote in message

news:ca**********@lust.ihug.co.nz...
> Hi, is it possible for a UserControl to get the Page name and

querystring
of
> its parent?
>
> e.g If a userControl is inside a page called "index.aspx?ID=66" how

can
a
> usercontrol print out this value? I was hoping there might be a
> Parent.PageName or Parent.Querystring method :)
>
> Thanks in advance
> John
>
>
>
>
>



Nov 18 '05 #5

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

Similar topics

3
by: David N | last post by:
Hi All, I just wonder if in C#, I can develop a user defined control that can call its parent function which is not yet developed. For example, how do I make my user control call a...
3
by: Todd Schinell | last post by:
Back in July, Jeffery Tan posted this: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OWOTdf0VDHA.2296%40cpmsftngxa06.phx.gbl In response as to how to get click events from a...
4
by: Mat | last post by:
Hi, I am having a bit of a problem trying to access / set properties of a usercontrol from the parent codebehind. This is what I have so far.. simple.aspx <%@ Page...
1
by: John A Grandy | last post by:
Let's say I have an .aspx Page instance derived from class "MyPage" (which of course inherits from System.Web.UI.Page). On the .aspx Page , I have "uc1", an instance of a UserControl dervived...
4
by: Ben Amada | last post by:
Hello, I have a user control which will be dynamically loaded from one of two parent ASPX webforms. Within the user control I'd like to be able to access a property from the parent webform. ...
1
by: Jimi | last post by:
Hi all, I have a user control which I want to raise a custom event from so the parent page can reload a datagrid with some new information. In the 1.1 framework days I would have just done...
5
by: Josh Nikle | last post by:
I have a webform containing a GridView control "GridView1" and usercontrol which is also a GridView "GridView2." I have a button column in the usercontrol. The code behind that button adds an...
0
by: CMELLO | last post by:
I have am dynamically loading a web user control based on the click of a tab strip I load the default control for the first tab in the page load event after checking page is not postback. After...
0
by: =?Utf-8?B?Y2luZHk=?= | last post by:
I have am dynamically loading a web user control based on the click of a tab strip I load the default control for the first tab in the page load event after checking page is not postback. After...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.