.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Me.image1.ImageUrl not displaying image when published

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :ASP.Net

 Hi Everyone,

I have a image control (image1) on a .aspx page and I'm trying to pass in a file system path (not a url) on my Page Load event:

Dim strPictureExists As String = \\rhino\groups\College Photo ID\ & strSID & ".jpg"

Dim strNoPhoto As String = "~/images/nophoto.jpg"

        If File.Exists(strPicture

View Complete Post

More Related Resource Links

Bitmap to Image Control - ImageUrl


 This is my first attempt at using the drawing features of asp.net.  I just want to start simple, and create a single color bar based on a value for a single graph.  I wrote this so far, but I can't figure out how to take the bitmap I just created, and apply it to the Image Control. Do I have to save the file first, and then reload it.

Plus, my box keeps coming out pure black, I trying to fill the box with a color. 

This is part of a web custom control, in which I dynamically created an Image Control. I want to apply the bitmap I made to the image control. 


Dim imgGoogle As Image
imgGoogle = New Image
imgGoogle.ImageAlign = ImageAlign.AbsMiddle
imgGoogle.ImageUrl = cs.GetWebResourceUrl(rsType, "ice5software.BotCatcher.Google.gif")
Private Sub DrawBarGraph_Google(ByVal BarValue As Integer)

	Dim objBitmap As System.Drawing.Bitmap
	Dim objGraphics As S

Displaying a System.Drawing.Bitmap in a WPF Image control

How would I convert a System.Drawing.Btimap into a comparable WPF image control so I can display in on my WPF window? Thanks

Use update progress control to change image control imageurl

UPDATE: Apologies for the previous formatting error - hopefully the post is now more readable... Hi I have a button with an image control next to it. Before the button is clicked, the image control "ConfirmedStatusImage" shows a "cancel.png" image. When the button has been clicked (and some other code successfully executed), then I change the imageurl for the "theConfirmedStatusImage" to show a "ok.png" image. Quite a bit of time can often pass between clicking the button and the associated code executing, so I have an ajax update progress control that shows a "bluespinner.gif" image while the page is updating after the button click. At the moment, the update progress updating image appears next to the "ConfirmedStatusImage" control. However, I would like to change things so that when the update progress starts, the imageurl of "ConfirmedStatusImage" changes from "cancel.png" to the update progress image (i.e., the "bluespinner.gif"). Then, when the update is complete, then the image should change to the "ok.png" image. My question is: how can I achieve this? As far as I can tell, the update progress control does not have any events that I can hook into. Also, placing the "ConfirmedStatusImage" inside the ProgressTemplate would not work either, as this only displays

ModalPopupExtender not displaying image

Hi guys,I have a modal popup extender with an asp:image control,  and 2 buttons.I have tried to load the image from a file on the local project folder which I have dynamically created through serverside code, but it will not display the image however I tried.here are the codes of the modalpopupextender and the hidden popup panel:            <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"                 TargetControlID="lbtn_HiddenLinkButton" BackgroundCssClass="ModalBackground"                 DropShadow="true" OkControlID="btn_DoneCropping"                 CancelControlID="btn_CancelCropping" PopupControlID="pnl_Cropper">            </asp:ModalPopupExtender>            <asp:Panel ID="pnl_Cropper" runat="server" CssClass="ModalPopup" style="display:none">              &

Displaying Image stored in rtf format in access database displaying it on crystal report

Hello, I'm working on a C# project combined with "Crystal Reports 10". When a user inserts something in a "TextField" in my C#-Program, it's saved  as RTF-code (Bolt,Pictures,Underlined,....) to a database.. So if they  reopen it in my "C#"-program they're able to see what they've entered  including their pictures .... But when I created a "Crystal Report"-file and combined it with the same  database used in my "C#"-program, it only show the formatted text and not  the pictures or images... Is there a way to show the "Picture" or "Image" they've inserted in RTF-code  ??? When I copy the code from the database in a simple Text-File and rename  it too "Test.rtf", it wil open correctly in word (with picture and  everything else)... So I hope there is a way to get the picture, Cz it's rather important  they've got a picture of the product they wanna print ...

problems displaying image in GridView

That's right, it's me again! For the third or fourth time around I'm trying to make this work... I want to display images in a Gridview, but I'm stuck at getting the images to display. The GridView shows only the image ID:s.My images are saved in the database as <Binary Data>. I'm using an aspx page as Image Handler that receives the binary data of the image from the database and writes it to a response stream (at least that's what the tutorial says I'm doing), and the I use an Image Control in Template field on GridView to call the handler. I've been following this tutorial, and also Mudassar Khans prevoius tutorials combined with other tutorials:http://www.aspsnippets.com/Articles/Display-images-from-SQL-Server-Database-in-ASP.Net-GridView-control.aspxThankful for help!Here's my code,Imagehandler: protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["ID"] != null) { string sql = "SELECT ImgData, ImgContType from" + " BildProd where id=@id"; String strConnString = System.Configuration.ConfigurationManager .ConnectionStrings["DBPejganConnectionString1"].ConnectionString; SqlCommand cmd = new SqlCommand(sql); cmd.Parameters.Add("@id", SqlDbType.Int).Value

how to dynamically set image's imagepath (imageURL) in the datalist1



Here i am again , with a new trouble Frown

I put a detalist in my vb.net web page. And bind with datasource, how can i bind a dynamical path on......


i solved by the working on the issue :)) Please find the following answer for setting dynamically setting the imageURL

        Dim img As Image
        Dim y1 As String = DropDownList1.SelectedItem.Value.ToString
        If DropDownList1.SelectedIndex = 1 Then
            y1 = "Genel"

Programmatically displaying an image in Gridview


Hi Guys,

I need your help!

I have a list of image names stored in a database, along with the id of the property they are associated with. I'd like to be able to display all of the images in a gridview and then allow the user to select the required image.

The problem I'm having is that the gridview is not displaying. I'm pretty sure it's something basic that I've missed, but can't for the life of me see what it is!

Any help would be greatly appreciated!


My gridview code in my aspx page:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">

My code behind (propId is the property id):

        query = "SELECT id, filepath "
                + "FROM images "
                + "WHERE id = ?id";

        MySql.Data.MySqlClient.MySqlCommand command = new MySql.Data.MySqlClient.MySqlCommand();
        command.CommandText = query;
        command.Connection = MyConn;
        command.Parameters.AddWithValue("?id", propId);

        MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter();
        da.SelectCommand = command;
        DataSet ds = new DataSe

"view state" does't work for Image's ImageURL in dynamic controls


Hi all. in my page_load method I call a mthod that it create some dynamic controls. one of them is an Image control that it's ImageURL property set to an URL that is saved in data base. image shows that URL but when postback ocuurs, previous image controls doesn't their image. but other controls for example TextBoxes keep text values. what should I do for keep image url property for this dynamic Images controls?


displaying image in report

Hello Guys, I am trying to display image on a report. The image field is stored as a binary data in the database. I am using webservice to access the database and return datasets through which data on the report can be accessed. I saw that the xml returns binarystring value from the database. but when i try to display the image it does not show me anything except blank page. I checked the value of the binary data and it does not proceed with ox and tried appending 0x value but no luck. Guys please help me.

Displaying waiting image when page is loaded in asp.net



I want to display gif image when a page is loaded...

I have a dropdown list when this is selected Gridview is populated with data from database..

I want to show a gif image when this gridview is populated...

how to implement this without AJAX...





Datalist not displaying image from database


My database table contains the image file path which will be stored from a
file upload control.The image path in the table will be like "C:\Projects\projectname\projectfolder\Files\1_129308367798080000_images1.jpg"

I am trying to display that image through a datalist control as follows
<asp:DataList ID="cobrandlogolist" runat="server">
                <asp:Image id="CobrandLogo" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "CobrandLogo") %>' Height="100px" Width="100px"


and i am retrieving the image names from the db and assigning as datasource of this datalist in the load event as follows

    DataTable dt = new DataTable();

ASP Image inside UpdatePanel changing ImageUrl



I have a WebForm which has an update panel. Inside the panel I have an ASP Image. I have also, 2 ImageButtons which act as the triggers for the UpdatePanel.

<asp:UpdatePanel ID="updImage" runat="server">
          <asp:AsyncPostBackTrigger ControlID="btnBackward" EventName="Click" />
          <asp:AsyncPostBackTrigger ControlID="btnForward" EventName="Click" />
          <asp:Image ID="Image1" runat="server" Width="75px" Height="75px" BorderStyle="Solid" BorderWidth="5px" BorderColor="White" />

In my WebForm, I also have an ASP Image component outside the Update panel.

The ImageUrl of those ASP Image components are loaded from a folder that is outside the WebSite root folder, using the code found in this link:


Displaying binary Image saved in a Database to Gridview ImageField


Dear Fren's

there is an issue

I have a coloumn in a database table in which i am storing the candidates photo in a binary format.

now i have to show these photo in a gridview according to the candidates rollno. i am trying to use the imagefield of a gridview control to display the photo but it is not displaying the photo in a grid view

please help me in this issue

thanks in advance  

When binding value to ImageUrl property of Image using XPath it shows code as html markup on fronten


I have a listview in which I want to show an image from an xmldatasource control.

The following works, and shows the value of thumb (in this case: 12_634232073402187500_whatever.jpg)

<asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" runat="server">
            <%# XPath("thumb")%>
<asp:XmlDataSource EnableCaching="false" XPath="root/data/compare/locations/location" ID="XMLDSCompare" runat="server"></asp:XmlDataSource>

No problem there, BUT, when I use an imagecontrol:

<asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" runat="server">
            <asp:Image ID="img" Visible='<%# XPath("thumb

Can't see image in firefox using imageurl property


Hi, I am trying to load an image in my webpage from a file server where all of our images will be held.I set the imageurl property on the image control to dynamically;;

image1.ImageUrl =photo+"//"+image1.jpg;(Here photo is a string that value is: "//server/DBV/Documents/Employee/phot")

and I can see the image perfectly fine in IE.

However, the image does not show in Firefox. In Firefox it is just a blank screen when i am using developer tools that image button is in there but it showing faded in developer tool(firebug).in screen nothing showing only blank.

Any body please help me urgently?????


Image not displaying in SSRS Report from moss 2007 list


Hi, I am generating SSRS report for one of sharepoint list, In this list one filed is picture type for KPI Indicators. After generating report i added picture field by using the below procedure:



Then it is displaying an image holder with RED CROSS image in it.

I tried a lot of things but not able to rectify this as Images for my report is mendatory.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend