473,498 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug mode path is not from root

When I go into debug mode and the web page I am working on opens in the
browser via the local Cassini Web Server I get a path appended onto the full
path e.g.

localhost:7859/FolderName/filename_that_should_be_in_the_root.aspx

this is a pain as I do my links from the root e.g. /css/site.css and the
additional folder in the path stops that. Is there any way to get the site
in debug mode to show

localhost:7859/filename_that_should_be_in_the_root.aspx

Regards, Chris.
Aug 2 '07 #1
3 2232
Hello Chris,
When I go into debug mode and the web page I am working on opens in
the browser via the local Cassini Web Server I get a path appended
onto the full path e.g.

localhost:7859/FolderName/filename_that_should_be_in_the_root.aspx

this is a pain as I do my links from the root e.g. /css/site.css and
the additional folder in the path stops that. Is there any way to get
the site in debug mode to show

localhost:7859/filename_that_should_be_in_the_root.aspx

Regards, Chris.
Because you'll never know the deployment url might change you need to write
your code agnostig of the deployment location.

If you have urls in controls (NavigateToUrl, PostBackUrl, ImageUrl etc) you
can use the ~/ notation to specify the application root.

The same goes for certain urls in the head section of a website (stylesheet
links are among those I believe).

You can also put your css files in a theme (put them in a folder called App_Themes\ThemeName)
and set the theme in the Pages tag of the web.config. All pages will automatically
load all css files in the specified themes directory. Should you ever need
to change the look & feel of the pages you can just change teh contents of
the theme directory and all pages will automatically load then new stylesheets.

Jesse
Aug 2 '07 #2
This is what I am doing. Say my website project sits in a folder called
MyProject and I have a css file in a folder css/mystyles.css

I would put the link as href="/css/mystyles.css"

However when I press F5 and go into debug mode the root from the localhost
becomes

localhost:7859/MyProject/css/mystyles.css

which makes my link stop work when in debug mode. It's fine on the live
server. Is there some setting somewhere as it seems so easy to break any
pathing from the root.

Regards, Chris.

"Jesse Houwing" <Je***********@nospam-sogeti.nlwrote in message
news:33*************************@news.microsoft.co m...
Hello Chris,
>When I go into debug mode and the web page I am working on opens in
the browser via the local Cassini Web Server I get a path appended
onto the full path e.g.

localhost:7859/FolderName/filename_that_should_be_in_the_root.aspx

this is a pain as I do my links from the root e.g. /css/site.css and
the additional folder in the path stops that. Is there any way to get
the site in debug mode to show

localhost:7859/filename_that_should_be_in_the_root.aspx

Regards, Chris.

Because you'll never know the deployment url might change you need to
write your code agnostig of the deployment location.

If you have urls in controls (NavigateToUrl, PostBackUrl, ImageUrl etc)
you can use the ~/ notation to specify the application root.

The same goes for certain urls in the head section of a website
(stylesheet links are among those I believe).

You can also put your css files in a theme (put them in a folder called
App_Themes\ThemeName) and set the theme in the Pages tag of the
web.config. All pages will automatically load all css files in the
specified themes directory. Should you ever need to change the look & feel
of the pages you can just change teh contents of the theme directory and
all pages will automatically load then new stylesheets.

Jesse


Aug 2 '07 #3
Hello Chris,
This is what I am doing. Say my website project sits in a folder
called MyProject and I have a css file in a folder css/mystyles.css

I would put the link as href="/css/mystyles.css"

However when I press F5 and go into debug mode the root from the
localhost becomes

localhost:7859/MyProject/css/mystyles.css

which makes my link stop work when in debug mode. It's fine on the
live server. Is there some setting somewhere as it seems so easy to
break any pathing from the root.
Did you have a look at the project properties sheet called "Debug" it allows
you to set such details. But appart from that. Have you tried settign teh
path to your CSS file to

~/css/mystyles.css

This should expand the path to the correct oen each and every time, regardless
of where you're going to deploy it. (You might need to add runat="server"
to the <headtag to make this work.

You could also try the Themes feature I pointed you to earlier.

It's better to cure the desease than to treat it's symptom in my opinion.

Jesse

Regards, Chris.

"Jesse Houwing" <Je***********@nospam-sogeti.nlwrote in message
news:33*************************@news.microsoft.co m...
>Hello Chris,
>>When I go into debug mode and the web page I am working on opens in
the browser via the local Cassini Web Server I get a path appended
onto the full path e.g.

localhost:7859/FolderName/filename_that_should_be_in_the_root.aspx

this is a pain as I do my links from the root e.g. /css/site.css and
the additional folder in the path stops that. Is there any way to
get the site in debug mode to show

localhost:7859/filename_that_should_be_in_the_root.aspx

Regards, Chris.
Because you'll never know the deployment url might change you need to
write your code agnostig of the deployment location.

If you have urls in controls (NavigateToUrl, PostBackUrl, ImageUrl
etc) you can use the ~/ notation to specify the application root.

The same goes for certain urls in the head section of a website
(stylesheet links are among those I believe).

You can also put your css files in a theme (put them in a folder
called App_Themes\ThemeName) and set the theme in the Pages tag of
the web.config. All pages will automatically load all css files in
the specified themes directory. Should you ever need to change the
look & feel of the pages you can just change teh contents of the
theme directory and all pages will automatically load then new
stylesheets.

Jesse

Aug 3 '07 #4

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

Similar topics

4
3668
by: Alexander Eisenhuth | last post by:
Hi alltogether, I use ActivePython 2.4.1 , also the debug part from http://ftp.activestate.com/ActivePython/etc/ and VC 6.0 unter Windows XP. I can't figure out howto debug my c++ extension....
2
2265
by: Chad Slagle via DotNetMonster.com | last post by:
in "c:\Root.Aspects.Exceptions\example.vb(20)" I receive an: error BC30456 'Insrumentation' is not a member of 'Aspects. In the Solution the following projects exist: Root.Aspects.Exceptions...
3
4895
by: roblenderman | last post by:
I start in debug mode and set a breakpoint on the page load event for the startup page. The browser opens and the page renders. The breakpoint turns to a "?" and says the breakpiont cannot be...
2
3937
by: Scott Yost | last post by:
I reference a .NET DLL to import some of my custom types. I can build that DLL in debug or release mode, but I usually keep the debug one built so I can debug it. When I want to link to the release...
2
5677
by: Artmic | last post by:
Hello can anyone help me with a MS-SQL2000 install and .Net + windows2000 advance server. I installed everything, and everything works fine on its own. But when i try to run my ASP.NET...
8
1908
by: | last post by:
I'm starting up the development server myself and using the "Startup Url" property of the web project. The problem is i cannot debug. The debug symbols are never loaded. I realize they are under...
11
1579
by: Lee Crabtree | last post by:
I've got a solution that has a C++ project that compiles to a DLL, and a C# project that is the main piece of the program. The DLL is managed C++ on top of regular C++. In one of the native...
0
2344
by: Andrew | last post by:
Hello Ive been messing around with a simple raw image viewer using Pil and Tkinter However I am running into problems displaying the images they appear to be not correct I believe it is cause of...
4
2245
by: Christiano Donke | last post by:
Hey there.. I don't know why my app doesn't validade the username/password when it's published... The code is working because in IDE it validates... any hint??? below is the validate function...
0
7168
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
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7381
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
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.