When I right click on ASP.NET development server, it says
http://localhost:1394/testing
as the ROOT URL. This does not go well with my code. I think the main reason is my code assumes it is in the root folder, and things start breaking when that is not the case. If I deploy this website, then it all works, but I lose my debugging capabilities. Is there a way I can make it skip the name of the folder (which is “testing” in this case)?
I am using virtual URL. Things break on virtual urls, not on static ones. (But virtual url works fine when deployed, and make sure it is in the root folder, otherwise it will not work.)
Here are the issues I am facing on virtual url’s. Images are broken, if I right click on them, it lists the url without the folder-name http://localhost:1394/images/xyz.jpg instead of http://localhost:1394/testing/images/xyz.jpg. If I click on an asp:button, it postbacks to http://localhost:1394/storecategory/virtualcategory.aspx instead of http://localhost:1394/testing/storecategory/virtualcategory.aspx. So, you see it is eating up testing from the url, so I wanted to see if there is a way I can make http://localhost:1394/ as the url instead of http://localhost:1394/testing/.
Please let me know if this is confusing.
Yes.
If you are building a Web Site project, click on the application name in the Solution Explorer, and then in the Properties pane find the “Virtual Path” property. Remove the folder name, leaving just the
/.If you are building a Web Application project, go to Properties | [Project Name] Properties… open the “Web” pane, and ensure that the “Virtual Path” value is set to
/.