Loading the image from DB to a image button in grid.

Posted by Gokul under Regular Expressions on 12/7/2010 | Points: 10 | Views : 1820 | Status : [Member] | Replies : 3
Dear Friends
I am working on how to load the images to DB and how to retrieve the image from DB. If i place a image as a template item in grid , the application is working well. If i place a image button instead of image in grid , the image is alone not loading in the image button. I ve done this with the hepl of handler file. Can any one help me in finding the solution for it????


Thanks in Advance


Regards
Gokulnath.N

Thanks and Regards,
GokulNath Nithy.



Responses

Posted by: T.saravanan on: 12/7/2010 [Member] [MVP] Silver | Points: 25
Posted by: Gokul on: 12/7/2010 [Member] Starter | Points: 25

Up
0
Down
Thanks Saravanan.
Your suggestion bet suited my application.
Now i have placed a image in the image button and if i click the image in the image button in grid, i ve set to navigate to zoom.aspx page where i placed a image tool. But in this, i am getting navigated but the image is not loaded in the image tool. I ve used java script to navigate to other page as,
function RunClientCode(e)
{
// var e1=e.substr(28,15);

var newwindow = null;
//var settings = 'width=650,height=6502,location=center,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,status=yes';
var url = 'zoom.aspx';
newwindow = window.open(url);
if (newwindow.focus){ newwindow.focus(); }
}

in aspx page:

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%# "Handler.ashx?autoid=" + Eval("Img_Id").ToString() %>' Width="100px"
Height="100px" Style="cursor: pointer" OnClientClick="return RunClientCode(this.src);" />


In zoom.aspx page:

<asp:image ID="Image1" runat="server"
ImageUrl='<%# "Handler.ashx?autoid=" + Eval("Img_Id").ToString()%>'
Height="650px" Width="100%" />

the above shoen is the coding. I ve used the handler page for this purpose.

Can you give me suggestion to load the image in the next page in image tool?

Regards
Gokul.N

Thanks and Regards,
GokulNath Nithy.

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

Posted by: T.saravanan on: 12/7/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Gokul,

How to call the image into image button the same way you can try in the next page.Get the image from DB (or) Server Path give the URL into image control.
For your Reference...

http://www.codeproject.com/KB/aspnet/ImageInDatabase.aspx

http://www.aspdotnetcodes.com/Insert_Images_Database.aspx

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.image.aspx

Cheers :)

Thanks,
T.Saravanan

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

Login to post response