Apply Server image as background div

Posted by Kasibabu under ASP.NET on 9/10/2011 | Points: 10 | Views : 1762 | Status : [Member] | Replies : 4
Please i need to apply binding exression to div but not working


public String GetImage(String ImageId)
{
strAccessKey = new GeneralDAL().GetS3SecretAccesskey();
clsS3 = new S3.iServ.FTP(strAccessKey);
S3.iServ.FTP.bucketName = "BackfeediPad";
if (ImageId != null)
return new GeneralDAL().GetImage_Web("Thumb_" + ImageId, clsS3, "image");// "clientrequest/DownloadFile.aspx?FileId=_" + imageUrl;
else
return "";
}

GetImage is here server method returns image paths from server
https://s3.amazonaws.com:443/BackfeediPad/Thumb_1325_634496907310625000.jpg?AWSAccessKeyId=0DYCX1JVYSQS3QBFN1R2&Expires=1315630015&Signature=kD7%2bJ%2fMe
https://s3.amazonaws.com:443/BackfeediPad/Thumb_1325_634496907310625000.jpg?AWSAccessKeyId=0DYCX1JVYSQS4QBFN1R2&Expires=1315630015&Signature=kD7%2bJ%2fMe
https://s3.amazonaws.com:443/BackfeediPad/Thumb_1325_634496907310625000.jpg?AWSAccessKeyId=0DYCX1JVYSQS5QBFN1R2&Expires=1315630015&Signature=kD7%2bJ%2fMe

<asp:GridView id=GridView1" runat="server">
<asp:BoundField DataField="SNO" HeaderText="SNO" />
<asp:BoundField DataField="NAME" HeaderText="NAME" />
<asp:BoundField DataField="PRICE" HeaderText="PRICE" />
<templetfiled>
<itemtemplet>
<div id="divImg" style="background-image:url('<%#GetImage(Eval("imageID").ToString()) %>') >
<img src="empty.gif">
</div>
</templetfiled>
<itemtemplet>
----------------not working.
my task is if right click on image in gridview and save atual image not be save. only empty image has to be saved.
view souce only contains the actual image paths.
getting paths from server are exctly correct.

Regards,
Kasi babu



Responses

Posted by: Vuyiswamb on: 9/10/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Debug the function GetImage() and check if it brings the correct path, if you think the path is correct, create an example page that pass the same path programmatically and check you can see the image, if you cant then that means they path is wrong

Thank you for posting at Dotnetfunda
[Administrator]

Kasibabu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kasibabu on: 9/10/2011 [Member] Starter | Points: 25

Up
0
Down
HI Vuyiswamb
even paths are correct but not applied image to grid

can u say any other way not be saved actual image of gridview when i rightclick on images of gridview

Regards,
Kasi babu

Kasibabu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 9/10/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down


looking at your path , it does not look correct for me

https://s3.amazonaws.com:443/BackfeediPad/Thumb_1325_634496907310625000.jpg?AWSAccessKeyId=0DYCX1JVYSQS5QBFN1R2&Expires=1315630015&Signature=kD7%2bJ%2fMe



it should be something like

https://s3.amazonaws.com:443/BackfeediPad/Thumb_1325_634496907310625000.jpg 



because the image control wont understand the path one more thing i saw, but i can tell you here on line. come to gtalk vuyiswamb[at]gmail.com

Thank you for posting at Dotnetfunda


Vuyiswa Maseko




Thank you for posting at Dotnetfunda
[Administrator]

Kasibabu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kasibabu on: 9/10/2011 [Member] Starter | Points: 25

Up
0
Down
hi
Vuyiswamb

can u send other ways to stop save as image in gridview.it has to save empty image only

Regards,
Kasi babu

Kasibabu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response