Solved

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

Posted on 2008-10-08
3
414 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

760 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now