473,322 Members | 1,314 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,322 software developers and data experts.

Tilde (~) not working in .NET 2 for HyperLink ImageURL

Hi,

I have just migrated my .NET 1.1 site to .NET 2.0. Most things are now
working except that a lot of my images aren't displaying if they
referenced the image path using ~.

eg:

<asp:hyperlink ID="searchLink" Runat="server"
NavigateUrl="search.aspx"
ImageUrl="~/images/search.gif"
Width="113" Height="20" />

In .NET 1.1, ~ would cause the image src to be output as:
"images/search.gif".

However in .NET 2.0, it outputs the ~ literally as:
"~/images/search.gif" so obviously the images don't load anymore.

The only solution I can think of is to manually set the image path in
code behind and call ResolveURL on the string. This seems REALLY messy
and will take me hours.

Why on earth does ~ no longer work in .NET 2.0?

Nick...
Feb 28 '06 #1
1 2272
Don't worry about this thread. It's miraculously started working.

Love .NET (not).
Feb 28 '06 #2

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

Similar topics

9
by: Leigh Kendall | last post by:
I can't find any issue in the MS KB, but I'm experiencing the following problem which seems to be specific to IE5, and NOT any other version of IE 5.5+ or NN 6+. Issue: I'm using an asp.net...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
2
by: Robson Carvalho Machado | last post by:
Dear friends, I'm dynamically creating a Hyperlink with spacer.gif as ImageURL that is an 1px transparent image only to determine link position, but as I create this link dynamically I could not...
1
by: MB2 | last post by:
I have code in a User Control for an image button like this: <asp:ImageButton id="__0" runat="server" text="Delete" ImageUrl="~/Images/ImageLibrary/icon_delete.gif" /> This used to work and it...
1
by: tshad | last post by:
Is there some reason why the Hyperlink in a DataGrid will not show an image? I have a datagrid with the following: <asp:TemplateColumn visible="false" HeaderText="Skills"> <itemtemplate>...
5
by: Patrick.O.Ige | last post by:
I want to have a rollover image on an hyperlink inside a Repeater control but when i run the page i get "Image1 is undefined" Any ideas? I have a Hyperlink and an Image control in a repeater...
8
by: Nathan Sokalski | last post by:
I have several System.Web.UI.WebControls.HyperLink Controls which I want to display as rollover images. I know how to make these manually using the <a> and <img> tags or the <a> tag and a...
4
by: ibiza | last post by:
Hi all, I have a problem which I don't understand with the "~" mark in a NavigateUrl property of an asp:HyperLink. I have this in a master page, to build the standard menu (rMenuItems is a...
15
by: Keith G Hicks | last post by:
I'm not sure what I'm doing wrong. Here's my code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim hyp As HyperLink =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.