?
Solved

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

Posted on 2008-10-08
3
Medium Priority
?
425 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
[X]
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
  • 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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.
Suggested Courses

777 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