Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > MasterPage and ContentPlaceHolder Path

Reply
Thread Tools

MasterPage and ContentPlaceHolder Path

 
 
Paul
Guest
Posts: n/a
 
      12-20-2007
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?
 
Reply With Quote
 
 
 
 
Mohamad Elarabi
Guest
Posts: n/a
 
      12-20-2007
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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Masterpage ContentPlaceHolder within quotes? Andrew Robinson ASP .Net 2 06-05-2006 05:12 AM
MasterPage - ContentPlaceHolder - How to navigate to the ContentPlaceHolder "Child Page" Greg ASP .Net 4 04-17-2006 03:48 PM
MasterPage - ContentPlaceHolder - How to navigate to the ContentPlaceHolder "Child Page" Greg ASP .Net Web Controls 1 03-23-2006 10:17 AM
[asp.net2] Masterpage und ContentPlaceHolder ausrichten Sebastian Meier ASP .Net 1 04-25-2005 10:41 AM
[asp.net2] Masterpage und ContentPlaceHolder ausrichten Sebastian Meier ASP .Net 0 04-23-2005 09:06 PM



Advertisments