CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_web_developer_2005_express Tags:
Item Type: NewsGroup Date Entered: 7/27/2004 7:27:03 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 40 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
theill
Asp.Net User
Changing "virtual path" of Visual Web Developer Web Server7/27/2004 7:27:03 PM

0/0

I'm developing a web application and want to avoid having to use a virtual path when executing the internal web server.

Currently I have a web site named "website". When I start the web server it will automatically setup a server on some port e.g. 269 and with a virtual path of "website". So I'm able to access the site via:

http://localhost:269/website

However I would like to access it via this url instead:

http://localhost:269/

and I can't see it should be a problem since the port is unique. I need this in order to use absolute paths in my HTML pages. I do this in order to ease the rearrangement of files e.g. if I have an HTML file in this location:

/projects
/test
/myfile.html

I'm able to refer to a .css file (in a 'css' folder from the root) using:

<link href="/css/mycssfile.css" />

I don't have to update this reference if I decides to move the "myfile.html" under e.g. "projects" instead of under "projects/test". I don't want to use urls such as "../../css/mycssfile.css".

Does anyone know how to change the "Virtual Path" part of the Visual Web Developer Web Server? That would solve my problem. Alternatively I could deply it to a virtual site under IIS but I don't want to do this during development.

spacemonkey4555
Asp.Net User
Re: Changing "virtual path" of Visual Web Developer Web Server7/28/2004 5:00:51 AM

0/0

Try using the ~ shortcut for your links. Instead of '/projects/test/', use '~/projects/test/'. ~ is a shortcut for the ApplicationPath of the site, 'website' in your example.

This is good because it makes your site more portable. You can develop on /website on your dev machine, FTP it to your production server on the root , and they both work. The '~' figures out the correct relative path for you.

One thing though, this only works for server controls, such as NavigateUrl Properties in the HyperLink/ButtonList/HyperLinkColumn (in the GridView). It also works for your CSS <link> tags in your head if your head has a runat="server" on it.

I wish the '~' would resolve to an absolute path, however.

Oh, and if you need the absolute path for a non-server control, use Request.ApplicationPath:

Test

Just a thought...
rick

http://techno-weenie.net
Fredrik N
Asp.Net User
Re: Changing "virtual path" of Visual Web Developer Web Server7/28/2004 7:18:27 AM

0/0

Create a new web project, in the Location input field you write http://localhost. But when doing this the web project will be located at the localhost. So if you do it for the next web project, it will override the existing one.

If you want to use IIS instead of the internal web server, you can select the Browse button when you create a new web site, and choose Local IIS.

Another solution is to use the "~" in the path (Will only work for server controls but will later also work for html controls).

Example:

<asp:Image ImageUrl="~/images/image.gif" runat="server"....>

The "~" will be translated to the virtual path. When this control is rendered during the runtime it will be:

/YourVirutalPath/images/images.gif

So by using "~" you don't need to worry about entering the name of the virtual path.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
theill
Asp.Net User
Re: Changing "virtual path" of Visual Web Developer Web Server7/28/2004 11:04:28 AM

0/0

Thanks. I'm already using ~ for my server controls and it works great. When you say "...but will later also work for html controls" does this mean it will work for standard (no "runat=xxx") html code such as this?

<link href="~/projects/test/mycss.css" />

If that's the case it's really good and I'll just temporarily create an html filter which will replace any "~/" with "Request.ApplicationPath". And then phase this out when it's a core feature in ASP.NET.

Fredrik N
Asp.Net User
Re: Changing &amp;quot;virtual path&amp;quot; of Visual Web Developer Web Server7/28/2004 1:33:41 PM

0/0

The "~" will work for HTML control marked with runat="server". This will probably work in beta 2. That is what I have heard.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
Wal474
Asp.Net User
Re: Changing "virtual path" of Visual Web Developer Web Server6/9/2005 10:48:55 AM

0/0

the head section is not responding to the runat server can you suggest anything ?

vitoravelino
Asp.Net User
Re: Changing "virtual path" of Visual Web Developer Web Server6/21/2007 5:17:45 PM

0/0

If I understood your question, open Solution Explorer and clique over root item (top most item). Then, in Properties Window, change the option Virtual path. I, usually, left just "/".
7 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Pro C# 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1370, Published: 2007
Build Your Own ASP.NET 2.0 Web Site Using C# & VB: The Ultimate ASP.NET Begginner's Guide Authors: Cristian Darie, Zak Ruvalcaba, Pages: 689, Published: 2006
Foundations of Popfly: Rapid Mashup Development Authors: Eric Griffin, Pages: 194, Published: 2008
Pro VB 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1377, Published: 2008
Pro VB 2005 and the .Net 2.0 Platform Authors: Andrew Troelsen, Pages: 1034, Published: 2006
Beginning SQL Server 2005 Express Database Applications: With Visual Basic Express and Visual Web Developer Express from Novice to Professional Authors: Rick Dobson, Pages: 596, Published: 2005
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Building Distributed Applications with Visual Basic.NET Authors: Dan Fox, Pages: 763, Published: 2002

Web:
Changing "virtual path" of Visual Web Developer Web Server - ASP ... Does anyone know how to change the "Virtual Path" part of the Visual Web Developer Web Server? That would solve my problem. ...
Visual Web Developer Team Blog : Downloadable Hotfix: Publish ... NET Development Server to use "/" as the Virtual path for when it runs. ... Your official information source from the Visual Web Developer team. ...
Rob Zelt - Lighting Up The Web - Visual Web Developer Web Server ... Visual Web Developer Web Server Usage: WebDec.WebServer /port: / path:[/vpath]. port number: ...
Chris May - Running ASP.NET Development Server Without Virtual ... NET Development Server Without Virtual Path, From Root ยท # ... WebServer.EXE ( note: this points to the web-server that VS usually automatically runs). ...
How to Change ASP.Net Development Server Virtual Path - ASP.NET Forums I noticed in the Visual Studio help that when it discusses changing the port for the web server it uses an example without a virtual path. ...
How to remove virtual path from root url of dev web server? - .NET ASP How to remove virtual path from root url of dev web server? ... In the Base URL box, type the URL that Visual Web Developer ...
Microsoft Expression Expression Web No support for virtual path or ... The title listed for this "bug" is: Virtual Path to Root ("relative path") does not ... a web site, which is a web site directly under the web server root. ...
IIS - Virtual path does not reflect changes : path, changes, does ... Web Browsers; Web Development; Web Servers; WebTrends / Stats .... I could be wrong about this, but if you are changing this path dynamically, why not also ...
How to Compile VWD Websites. Instructions for Precompiling Visual ... Instructions for Precompiling Visual Web Developer and ASP.NET 2.0 site code. ... -v, The virtual path of the application to be compiled (e.g. "/MyApp"). ...
CodeProject: Creating Custom Virtual Path Provider in ASP.Net 2.0 ... Virtual path provider in ASP.Net 2.0 is a way to make the world believe that something exists on the server which in reality is not. This enables the web ...




Search This Site:










visual studio.net html formatting

bandwidth restrictions per portal (on a dedicated server) ?

mk.bat

asp:image and master pages..an easy one i think!

displaying html in a textbox

how to get ad user

using portal.css upon private assembly module

treeview not working when migrated to 2.0

? re: experience with dnn content builder

setting user control property programmatically

how to transfer customerid from orderlist.aspx to orderdetail.aspx

to modify the noun of the dotnetnuke.all project?

posting or replying on forums page

undo add module to all pages

dev environment really slow to load dnn

ack. the old "there is a problem with your selected data store. this can be caused by an invalid server name or credentials..." error message in trying to change my provider from sqlexpress to sql2k...

sever problem with references usnig asp.net vb projects

custom sitemapprovider that should get fresh data when parameters changes

convert to partial classes

web adminisration tool....

form authentication

aspnet_regiis.exe "cannot be opened" error

ngallery to dnn gallery converter

new httpresponse class, please help

asp.net web admin with custom provider

is it possible to run custom controls in <title><meta> tags without placing the form tag at the start of the page?

runtime error

dnn 2 win 2003 permissions

converting treeview

securing .doc / .pdf or .xml files under forms authentication

 
All Times Are GMT