Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting the physical path of a web application through a custom web control

Posted on 2008-10-08
3
421 Views
Last Modified: 2013-11-26
Hello,

I would like to know the path of the web application at DESIGN TIME for use in a custom web control.

I cannot use Page.Request.ApplicatonPath as that is runtime
System.AppDomain.CurrentDomain.BaseDirectory returns the visual studio folder
Page.MapPath(name) is runtime.

Any help would be appreciated. Cheers!

0
Comment
Question by:Onthrax
  • 2
3 Comments
 
LVL 14

Expert Comment

by:Ramuncikas
ID: 22667664
0
 
LVL 13

Author Comment

by:Onthrax
ID: 22668107
Unfortunately only returns at run time not design time :(
0
 
LVL 13

Accepted Solution

by:
Onthrax earned 0 total points
ID: 22668319
               Dim webApplication As IWebApplication = DirectCast(Me.Site.GetService(GetType(IWebApplication)), IWebApplication)
                Dim projectPath As String = webApplication.RootProjectItem.PhysicalPath

That seems to do it.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question