Hello Dear Sir or Madam
I have a RadGrid on a site called: http://portal.recris.info
I have this site's admin site, under the URL: http://admin.recris.info
In the admin site, the users are manipulating the database, inserting, editing and deleting records.
In the RadGrid i mentioned earlier on portal.recris.info, I entered 4 image columns, in which I want to show the images, stored in the admin site.
For example in the database, there is a record with the Ship_photo1 field with the value: ~/images/accidents/Mega Bay - Ship-2-3.jpg, the Ship_Photo_2: ~/images/accidents/Jellyfish.jpg
I want these images to be seen in the portal.recris.info site.
I have the following code behind:
and the following code at the .aspx file:
but it seems not working as expected.
At the portal.recris.info site, looking at the image properties, (from the browser's properties) I have the following:
http://portal.recris.info/images/ships/1162125%20Aiolos%201.jpg
but I need to be: http://admin.recris.info/images/ships/1162125%20Aiolos%201.jpg
Can you please take a look at the code, and tell me where I did the mistake?
Yours
Velissarios Housos
vhousos@gmail.com
I have a RadGrid on a site called: http://portal.recris.info
I have this site's admin site, under the URL: http://admin.recris.info
In the admin site, the users are manipulating the database, inserting, editing and deleting records.
In the RadGrid i mentioned earlier on portal.recris.info, I entered 4 image columns, in which I want to show the images, stored in the admin site.
For example in the database, there is a record with the Ship_photo1 field with the value: ~/images/accidents/Mega Bay - Ship-2-3.jpg, the Ship_Photo_2: ~/images/accidents/Jellyfish.jpg
I want these images to be seen in the portal.recris.info site.
I have the following code behind:
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
If TypeOf e.Item Is GridDataItem Then
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim strImageUrl1 As String = item.GetDataKeyValue("Ship_Photo_1").ToString()
DirectCast(item("Ship_Photo_1").Controls(16), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl1.Replace("~/", "")
Dim strImageUrl As String = item.GetDataKeyValue("Ship_Photo_2").ToString()
DirectCast(item("Ship_Photo_2").Controls(17), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl.Replace("~/", "")
Dim strImageUrl2 As String = item.GetDataKeyValue("Accident_Photo_1").ToString()
DirectCast(item("Accident_Photo_1").Controls(18), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl2.Replace("~/", "")
Dim strImageUrl3 As String = item.GetDataKeyValue("Accident_Photo_2").ToString()
DirectCast(item("Accident_Photo_2").Controls(19), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl3.Replace("~/", "")
End If
End Sub
and the following code at the .aspx file:
<
telerik:GridImageColumn
DataImageUrlFields
=
"Ship_Photo_1"
HeaderText
=
"Ship Photo 1"
ImageAlign
=
"Left"
ImageHeight
=
""
ImageWidth
=
"150px"
UniqueName
=
"Ship_Photo_1"
AllowFiltering
=
"False"
>
</
telerik:GridImageColumn
>
<
telerik:GridImageColumn
DataImageUrlFields
=
"Ship_Photo_2"
HeaderText
=
"Ship Photo 2"
ImageAlign
=
"Left"
ImageHeight
=
""
ImageWidth
=
"150px"
UniqueName
=
"Ship_Photo_2"
AllowFiltering
=
"False"
>
</
telerik:GridImageColumn
>
<
telerik:GridImageColumn
DataImageUrlFields
=
"Accident_Photo_1"
HeaderText
=
"Accident Photo 1"
ImageAlign
=
"Left"
ImageHeight
=
""
ImageWidth
=
"150px"
UniqueName
=
"Accident_Photo_1"
AllowFiltering
=
"False"
>
</
telerik:GridImageColumn
>
<
telerik:GridImageColumn
DataImageUrlFields
=
"Accident_Photo_2"
HeaderText
=
"Accident Photo 2"
ImageAlign
=
"Left"
ImageHeight
=
""
ImageWidth
=
"150px"
UniqueName
=
"Accident_Photo_2"
AllowFiltering
=
"False"
>
</
telerik:GridImageColumn
>
but it seems not working as expected.
At the portal.recris.info site, looking at the image properties, (from the browser's properties) I have the following:
http://portal.recris.info/images/ships/1162125%20Aiolos%201.jpg
but I need to be: http://admin.recris.info/images/ships/1162125%20Aiolos%201.jpg
Can you please take a look at the code, and tell me where I did the mistake?
Yours
Velissarios Housos
vhousos@gmail.com