N
Nick Gilbert
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...
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...