All the standard ASP.net controls that have a ImageURL property accept relative urls (ex. ~/img/image.gif)
When I place a relative URL into a Rad Rating Item, it doesn't resolve the URL, it simply embeds this as a literal value to the page's CSS.
I can adjust the URL's accordingly by removing the ~/ and change it to an absolute path, however when published to a server sometimes the path is a little different. This results in the images not displaying because the CSS is pointing to the wrong place. Is this by design?
I used this code to resolve the URLs so that I could use relative paths in the image URL properties:
Is there ever going to be an implementation of allowing relative paths in the image URL fields?
When I place a relative URL into a Rad Rating Item, it doesn't resolve the URL, it simply embeds this as a literal value to the page's CSS.
<
telerik:RadRatingItem
CssClass
=
"ratingItem"
Value
=
"1"
ImageUrl
=
"~/img/ratings/rating_1_normal.png"
ToolTip
=
"Very Easy"
SelectedImageUrl
=
"~/img/ratings/rating_1_selected.png"
HoveredImageUrl
=
"~/img/ratings/rating_1_hover.png"
/>
I can adjust the URL's accordingly by removing the ~/ and change it to an absolute path, however when published to a server sometimes the path is a little different. This results in the images not displaying because the CSS is pointing to the wrong place. Is this by design?
I used this code to resolve the URLs so that I could use relative paths in the image URL properties:
If String.IsNullOrEmpty(item.ImageUrl) = False Then
If item.ImageUrl.StartsWith("~/") Then
item.ImageUrl = ResolveUrl(item.ImageUrl)
End If
End If
If String.IsNullOrEmpty(item.SelectedImageUrl) = False Then
If item.SelectedImageUrl.StartsWith("~/") Then
item.SelectedImageUrl = ResolveUrl(item.SelectedImageUrl)
End If
End If
If String.IsNullOrEmpty(item.HoveredImageUrl) = False Then
If item.HoveredImageUrl.StartsWith("~/") Then
item.HoveredImageUrl = ResolveUrl(item.HoveredImageUrl)
End If
End If
If String.IsNullOrEmpty(item.HoveredSelectedImageUrl) = False Then
If item.HoveredSelectedImageUrl.StartsWith("~/") Then
item.HoveredSelectedImageUrl = ResolveUrl(item.HoveredSelectedImageUrl)
End If
End If
Is there ever going to be an implementation of allowing relative paths in the image URL fields?