473,739 Members | 4,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repost: absolute paths when using "View in Browser" on local port

Earlier I had inquired as to why a normal <a hreftag didn't work when
using the VS hosted site using a random local port. The more I think about
it, this seems very wrong.

Using the random port hosted site, if I have <a href="/mypage.aspx">, this
link doesn't seem to work? I've verified this by creating a simple .htm
page with a link like this, then do a "View in browser". Clicking the link
results in page not found. I guess this is because the normal href doesn't
specify the port, eh?

Doesn't this seem bogus? It sure makes things harder to test. Granted you
can use a <asp:HyperLink> , but that seems like overkill in many cases.

Amil

=============== =========
Hello Amil,

Typically you'll need it to be a relative path not a root path for this to
work. I usually do the ~/graphics/myimage.jpg trick, but that means that
the <img /needs a runat="server" in the tag.

HTH
Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
I use the VS 2005 option "View in browser" to often view my web site.
If I have a link in there like:

<img src="/graphics/myimage.jpg">

This doesn't work even though the image is really there. I'm sure
this has to do with the fact that the page is being served out of the
virtual server/port that VS fires up to serve the page.

This seems bogus...I can't even see my content? Am I doing something
wrong? I've tried using stuff like ~/graphics/myimage.jpg, but that
doesn't work either.

Amil


Jul 26 '06 #1
0 1321

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

Similar topics

7
4536
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm" ACTION="UploadAction.asp" METHOD="POST" enctype=multipart/form-data> <input type="file" name="fileName"> //etc ... </FORM>
18
2555
by: Lorem Ipsum | last post by:
interesting! I just found a page in which Explorer's View Source does nothing! How did they do that?
1
1611
by: dw | last post by:
Hello, all. I have a site that works fine when viewed in IE apart from the project in Visual Studio .NET 2003. However, when I right-click and do View in Browser, it tries to open it in the wrong site. It keeps bringing it up with the wrong address and gives an error because the page isn't at that address; I corrected the address in the Webinfo file, but it kept going back to the incorrect address. It must be storing it somewhere else....
2
1614
by: | last post by:
I like the "view in browser" feature of vs.net: right click from an aspx page, and preview a working version of the page. I don't like how this can't be launched from the pages' codebehind. The "view in browser" option does not appear on the context menu of VS.NET 2005. Is there a workaround or hotkey that I can use to launch a preview from the codebehind page? -KF
5
1512
by: jfinnell | last post by:
Hi I'm working with the beta version of this product. I place the web in my master page, then link to my other pages. Set them up. When I select view in browser to check what I have done everything is scewed. The menu, borders everything any suggestions. I use relative positioning.
1
1430
by: Amil Hanish | last post by:
I use the VS 2005 option "View in browser" to often view my web site. If I have a link in there like: <img src="/graphics/myimage.jpg"> This doesn't work even though the image is really there. I'm sure this has to do with the fact that the page is being served out of the virtual server/port that VS fires up to serve the page. This seems bogus...I can't even see my content? Am I doing something wrong?
1
4875
by: Nalaka | last post by:
I had ..... <%@ OutputCache Duration="5000" Location="Server" VaryByParam="none" %> Then I added "browser" <%@ OutputCache Duration="5000" Location="Server" VaryByParam="none" VaryByCustom="browser" %> After I added browser... it stopped caching pages.... is there an explanation or... did I observe the problem wrong?
4
30727
by: marcnz | last post by:
Hi, I am working for a company which as a MS SQL backend and Access as front end. We update automatically each access db on the user local machine when a new feature has become available. We have to stay with MDB for several reasons, so please avoid telling me "you have to convert to MDE"... It is not an option. We need to allow our users to have the right-click so they can export the reports to pdf or other format. We need to remove...
4
2820
by: python | last post by:
I'm looking at rewriting some legacy VB applications and am pondering which of the following techniques to use: 1. Browser based GUI with local web server (Browser + wsgiref.simple_server) (I'm assuming that simple_server is class I want to build from for a local web server) -OR- 2. wxPython based GUI
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6754
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4570
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3280
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 we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.