473,512 Members | 15,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MasterPage and ContentPlaceHolder Path

I have a master page and a ContentPlaceHolder page in a typical master page
imlpmentation.

Does anyone know the property or method that I can use to retrieve the file
path/location of the ContentPlaceHolder page?
Dec 20 '07 #1
1 1157
Did you mean the path of the Content page?
If that is what you meant then you would just get that normally from the
Request object regardless of whether you're in the Content page or the
MasterPage. The request object returns information regarding the web request
that the server is currently processing. One of many options is

Request.FilePath
Request.Path
Request.PhysicalPath

There are many "path" resolving properties in the Request object. Some of
these return Physical path as in "C:\MySites\MyApp\default.aspx" and some
return virtual paths like "\default.aspx"

If you want to resolve a Virtual path to a physical one then you would use
Page.MapPath method and pass it a virtual path like so

MyPhysicalPath = Page.MapPath(Request.FilePath)

Hope that helps.
--
Mohamad Elarabi
Lead Developer. MCTS, MCPD.
"Paul" wrote:
I have a master page and a ContentPlaceHolder page in a typical master page
imlpmentation.

Does anyone know the property or method that I can use to retrieve the file
path/location of the ContentPlaceHolder page?
Dec 20 '07 #2

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

Similar topics

3
4062
by: MRW | last post by:
I have a simple linkbutton and a function when it's clicked. It works perfectly in a regular .aspx page. However, when I place it inside the ContentPlaceHolder, it no longer works. It does...
6
6164
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, WHen I specify my master page in the page's @Page directive, no problems. However, when I put it ias an attribute in Web.config's page element, the designer fails. It just says "Error...
8
2079
by: Randy Smith | last post by:
Hi, I now need to add MasterPages to a number of existing forms, but when I add the code for MasterPage, the MasterPage does NOT appear when it runs. Any thoughts? TIA, Randy Smith
3
3514
by: Tor Inge Rislaa | last post by:
I have a MasterPage containing a TreeView menu. When clicking a menu item, a page is loaded into the ContentPlaceHolder. It seems like both the MasterPage and the page in the ContentPlaceHolder is...
0
7252
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
7153
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
7517
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...
1
5077
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...
0
4743
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...
0
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.