hi..
i want to show the retrieved image in a image control in asp.net..
i was retrieved that image in sqlserver database.. but i want to show that retrieved image in image control in asp.net...
i want coding for that in asp.net...
regards
gopal
Loading
Bechir BejaouiPosted Feb 11, 2009, 3:30 PM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
You can for example create a css(style sheet) file within which you precise the image characterstics and the add a link to this style sheet link to your asp page in the head,and the fix the cssClass attribute of your image control to the name of your css file
at last but not least you can do this programmatically
public partial class _Default : System.Web.UI.Page
{
Image myImage;
protected void Page_Load(object sender, EventArgs e)
{
myImage = new Image();
myImage.Width = 200;
myImage.Height = 200;
myImage.ImageUrl = "http://www.c-sharpcorner.com/Forums/App_Themes/CSharp/Images/ForumLogo.gif";
myImage.Visible = true;
this.Controls.Add(myImage);
}
}