473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

what about aspx files in web root, if projects always published in directories?

If you create a ASP.Net Web application in Visual Studio .Net, you
apparently have to specify the target as a directory on a web server,
e.g. www.hostname.com/dirname, with "dirname" being the name of the
locally created project. I can't find a way to create an .aspx file
and publish it straight to the Web root directory in VS .Net.

And yet of course there are many sites with .aspx files located in the
Web root directory. Does that usually mean the authors edited the
..aspx files in VS .Net but saved them statically and uploaded them via
regular FTP to the root directory? Or that they have configured IIS
so that the root directory is aliased to the sub-directory where the
project lives? Usually this is a sign that I'm fundamentally looking
at something the wrong way; did I do it again?

-Bennett
Nov 18 '05 #1
7 1529
In my development i am trying to use '~' sign whenever is possible.
As you probably know that ~ sign replaces the path to the Application Folder.
Example:
Response.Redirect("/dirname/my.aspx") --- wrong
Response.Redirect("~/my.aspx") --- correct.

Obviously the ~ approach only works when the URL is interpreted by ASP.NET engine.
If you have in your HTML <img src="~/my.asp"> It will stay that way and will not work.
So for those cases I have a small application "replacer" which runs through folder/subfolders and replaces the phrase1 --> phrase2
George
My Site - Body Jewelry
"Bennett Haselton" <be*****@peacefire.org> wrote in message news:e6**************************@posting.google.c om...
If you create a ASP.Net Web application in Visual Studio .Net, you
apparently have to specify the target as a directory on a web server,
e.g. www.hostname.com/dirname, with "dirname" being the name of the
locally created project. I can't find a way to create an .aspx file
and publish it straight to the Web root directory in VS .Net.

And yet of course there are many sites with .aspx files located in the
Web root directory. Does that usually mean the authors edited the
.aspx files in VS .Net but saved them statically and uploaded them via
regular FTP to the root directory? Or that they have configured IIS
so that the root directory is aliased to the sub-directory where the
project lives? Usually this is a sign that I'm fundamentally looking
at something the wrong way; did I do it again?

-Bennett
Nov 18 '05 #2
"George" <no****@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
In my development i am trying to use '~' sign whenever is possible.
As you probably know that ~ sign replaces the path to the Application Folder.
Example:
Response.Redirect("/dirname/my.aspx") --- wrong
Response.Redirect("~/my.aspx") --- correct.

Obviously the ~ approach only works when the URL is interpreted by ASP.NET engine.
If you have in your HTML <img src="~/my.asp"> It will stay that way and will not work.
You can change the above to <img runat="server" src="~/my.gif"> and it will work.
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #3
Hi Bennett,

Yup, you did it again. ;)

You can create a project in the root of a website. When creating the
project, just use the url of your site without a sub folder:

http://localhost will create a project in the root of your website. Of
course, if there is already a project defined there, VS.NET will bark at you
about it. :)

--
HTH

Kyril Magnos

Question of the day:
What is Mono?
A) Disease where the lymph nodes become swollen.
B) A single sound
C) A synonym for one
D) A port of .NET meant to royally irritate MSFT
E) All of the above.

"Bennett Haselton" <be*****@peacefire.org> wrote in message
news:e6**************************@posting.google.c om...
| If you create a ASP.Net Web application in Visual Studio .Net, you
| apparently have to specify the target as a directory on a web server,
| e.g. www.hostname.com/dirname, with "dirname" being the name of the
| locally created project. I can't find a way to create an .aspx file
| and publish it straight to the Web root directory in VS .Net.
|
| And yet of course there are many sites with .aspx files located in the
| Web root directory. Does that usually mean the authors edited the
| .aspx files in VS .Net but saved them statically and uploaded them via
| regular FTP to the root directory? Or that they have configured IIS
| so that the root directory is aliased to the sub-directory where the
| project lives? Usually this is a sign that I'm fundamentally looking
| at something the wrong way; did I do it again?
|
| -Bennett
Nov 18 '05 #4
<img runat="server" src="~/my.gif"> for every image on a page is a big waist.

Do not come back saying that ASP.NET is slow.
George
My Site - Body Jewelry
"John Saunders" <jo**************@notcoldmail.com> wrote in message news:O0**************@TK2MSFTNGP10.phx.gbl...
"George" <no****@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
In my development i am trying to use '~' sign whenever is possible.
As you probably know that ~ sign replaces the path to the Application Folder.
Example:
Response.Redirect("/dirname/my.aspx") --- wrong
Response.Redirect("~/my.aspx") --- correct.

Obviously the ~ approach only works when the URL is interpreted by ASP.NET engine.
If you have in your HTML <img src="~/my.asp"> It will stay that way and will not work.
You can change the above to <img runat="server" src="~/my.gif"> and it will work.
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #5
"George" <no****@hotmail.com> wrote in message news:Of**************@TK2MSFTNGP12.phx.gbl...
<img runat="server" src="~/my.gif"> for every image on a page is a big waist.

Do not come back saying that ASP.NET is slow.
Of course, you know this by measurement?

Recall that pages are compiled. The translation from "~/my.gif" to http://www.site.com/my.gif will occur once.
--
John Saunders
johnwsaundersiii at hotmail
George
My Site - Body Jewelry
"John Saunders" <jo**************@notcoldmail.com> wrote in message news:O0**************@TK2MSFTNGP10.phx.gbl...
"George" <no****@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
In my development i am trying to use '~' sign whenever is possible.
As you probably know that ~ sign replaces the path to the Application Folder.
Example:
Response.Redirect("/dirname/my.aspx") --- wrong
Response.Redirect("~/my.aspx") --- correct.

Obviously the ~ approach only works when the URL is interpreted by ASP.NET engine.
If you have in your HTML <img src="~/my.asp"> It will stay that way and will not work.
You can change the above to <img runat="server" src="~/my.gif"> and it will work.
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #6
"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
Hi Bennett,

Yup, you did it again. ;)

You can create a project in the root of a website. When creating the
project, just use the url of your site without a sub folder:

http://localhost will create a project in the root of your website. Of
course, if there is already a project defined there, VS.NET will bark at you about it. :)
You will also have problems if you're using a source control system and you
have other developers working on the same project. They will _all_ have to
use http://localhost as the location for the web site. That's yet another
reason to use http://localhost/project.
--
John Saunders
johnwsaundersiii at hotmail


"Bennett Haselton" <be*****@peacefire.org> wrote in message
news:e6**************************@posting.google.c om...
| If you create a ASP.Net Web application in Visual Studio .Net, you
| apparently have to specify the target as a directory on a web server,
| e.g. www.hostname.com/dirname, with "dirname" being the name of the
| locally created project. I can't find a way to create an .aspx file
| and publish it straight to the Web root directory in VS .Net.
|
| And yet of course there are many sites with .aspx files located in the
| Web root directory. Does that usually mean the authors edited the
| .aspx files in VS .Net but saved them statically and uploaded them via
| regular FTP to the root directory? Or that they have configured IIS
| so that the root directory is aliased to the sub-directory where the
| project lives? Usually this is a sign that I'm fundamentally looking
| at something the wrong way; did I do it again?
|
| -Bennett

Nov 18 '05 #7
Thanks, that worked!

I had only seen that when I typed http://www.hostname.com/projname/ as
the name of the project, it would force the project to be named
"projname", and when I specified http://www.hostname.com/ as the
location, it would show the project name as blank. It didn't occur to
me to delete the trailing "/", so that if I specify
http://www.hostname.com as the location, it lets me create a project
called www.hostname.com :)

"Kyril Magnos" <ky**********@yahoo.com> wrote in message news:<e3**************@tk2msftngp13.phx.gbl>...
Hi Bennett,

Yup, you did it again. ;)

You can create a project in the root of a website. When creating the
project, just use the url of your site without a sub folder:

http://localhost will create a project in the root of your website. Of
course, if there is already a project defined there, VS.NET will bark at you
about it. :)

--
HTH

Kyril Magnos

Question of the day:
What is Mono?
A) Disease where the lymph nodes become swollen.
B) A single sound
C) A synonym for one
D) A port of .NET meant to royally irritate MSFT
E) All of the above.

"Bennett Haselton" <be*****@peacefire.org> wrote in message
news:e6**************************@posting.google.c om...
| If you create a ASP.Net Web application in Visual Studio .Net, you
| apparently have to specify the target as a directory on a web server,
| e.g. www.hostname.com/dirname, with "dirname" being the name of the
| locally created project. I can't find a way to create an .aspx file
| and publish it straight to the Web root directory in VS .Net.
|
| And yet of course there are many sites with .aspx files located in the
| Web root directory. Does that usually mean the authors edited the
| .aspx files in VS .Net but saved them statically and uploaded them via
| regular FTP to the root directory? Or that they have configured IIS
| so that the root directory is aliased to the sub-directory where the
| project lives? Usually this is a sign that I'm fundamentally looking
| at something the wrong way; did I do it again?
|
| -Bennett

Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: davidw | last post by:
I am using microsoft development enviroment 2003. I created a solution, and have some projects, I put the root dir as my IIS home, and each project has their own directory, so it is like ...
1
by: huzz | last post by:
I need to write script in c# that will scan directories for files and insert the files and directory names in the database.. I've have two tables tblDir and tblDocs. Example: -Directory1...
9
by: Patty O'Dors | last post by:
Hi Can somebody please tell me what namespaces are actually for? I notice that when I start a new project in C#, it puts everything in a namespace of the same name as the project. I found them...
0
by: Tim Smith | last post by:
Dear All, Uncovered a problem with a home grown site replicator. We have directory browsing enabled to allow our remote clients to "dynamically discover" new files/directories (sites) we have...
4
by: Jerry | last post by:
I'm having just a bit of trouble wrapping my brain around the task of working with folders that are above the site's root folder. I let users upload photos (.jpg/.gif files) which can...
4
by: Randall Parker | last post by:
XP Home does not come with IIS. Can one use VS 2003 or some other tool to view aspx pages one is developing and do that on XP Home without having IIS on the machine?
2
by: PAF | last post by:
Hi all, I don't understand something... First: I have a Web Site project that provide web services who use some other libraries projects. When I build my Web Site, bin folder is created...
3
by: =?Utf-8?B?TWlrZQ==?= | last post by:
I have an asp.net 2.0 web application that I have pre-compiled and deployed to a Windows 2003 server. When I try to access the web application I get the following message in my browser: 'The...
5
by: DCDev | last post by:
I have a solution with multiple projects. One project is a windows forms project. I have report files (.rdlc) in a separate project that are built as "Content" with the "Copy Always" option....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.