开发者

How to add System.Drawing.Image object to Asp:Image Control

How to add System.Drawing.Image object to Asp:Image Control but I dint have imageId in my table.Image field is in another table..i retrieve image from database in Image object.i want to display it in asp:Image control or grid view.how to do it?? pls send repl开发者_JS百科y... C#


The Image class and <asp:image> control are completely different thing. You need to have a page or http handler to write the Image object as an image file such as .jpg / .png / .gif. And then use the <asp:image> control to access the URL of your page or http handler to get the image file you generated and display it. <asp:image> basically only render a HTML <img> tag with the URL of the image.


You can use this ASP.NET module and the SqlReader plugin to serve images directly from the database.

You can then reference the images like so:

<asp:Image runat="server" ImageUrl="/sqlimages/[imageidhere]" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜