473,587 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MasterPage and ContentPlaceHol der Path

I have a master page and a ContentPlaceHol der 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 ContentPlaceHol der page?
Dec 20 '07 #1
1 1165
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.FilePat h
Request.Path
Request.Physica lPath

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

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(Re quest.FilePath)

Hope that helps.
--
Mohamad Elarabi
Lead Developer. MCTS, MCPD.
"Paul" wrote:
I have a master page and a ContentPlaceHol der 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 ContentPlaceHol der page?
Dec 20 '07 #2

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

Similar topics

3
4065
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 *something*, but certainly not the function, which is also in the ContentPlaceHolder. This is also true concerning any events in there. Any ideas? ...
6
6169
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 Creating Control - Content. Content controsl can only be used in a content page." I know that there's an issue w/ nested masters, but I'm only trying to...
8
2087
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
3518
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 refreshed when clicking the menu item. That might be how it is supposed to be, but the problem is that the menu in the masterpage returns to it's...
0
7920
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...
0
7849
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...
0
8347
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...
1
7973
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5394
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...
0
3844
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...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.