.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

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

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


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"

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

Dynamically Get The Image in Javascript

Dear all,   I have a filePhoto control and Image control in my aspx page when I click on Filephoto control i am able to get the path in the control i need the image to be set to Image control .Thanks In advance

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

play storyboard with dynamically created image

this is my storyboard:   <Storyboard x:Key="expandStoryboard"> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="2" Duration="0:0:0.2" /> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="2" Duration="0:0:0.2" /> </Storyboard> <!-- This storyboard will make the image revert to its original size --> <Storyboard x:Key="shrinkStoryboard"> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="0:0:0.2" /> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="0:0:0.2" /> </Storyboard>   and i created image dynamically:   BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.UriSource = new Uri("file:///" + arrstrFileNames[0].Replace("\\", "/")); bmp.EndInit(); Image img = new Image(); img.Source = bmp; RotateTransform rt = new RotateTransform(); img.LayoutTransform = rt; ScaleTransform st = new ScaleTransform(); st.ScaleX = 1; st.ScaleY = 1; img.LayoutTransform = st; if(first==true) img.ContextMenu = mnu; first = false; assignEv

adding an external image dynamically

hi Folks, i got a report with an image, the full qualified image is stored in an attribute like http://vmt-moss/Immo/NA23/NA23.jpg if I set the the property in SQL 2008 R1 RS to external and the value to imagepath (where the http link is stored) nothing doesn't been displayed. Additonally i am setting an Action to the image property, where also the imagepath value has been set, if click onto the image, image has been opened properly. Do I have to format the value to a Url Format ?   thx for your help

Dynamically generating of hot spots on image


HI all,
           I am facing problem with the dynalically generating the image at particular with coordinate points on image map through code behind (aspx.cs).
    As per my requirement i need to generate Hotspots dynamically and also displaying an image to indicate the Hot spots.
Please send me the code above that ...

thanks in advance

Me.image1.ImageUrl not displaying image when published


 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 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?


Dynamically generate image on image map or image button


Here is this thing which to me looks possible, but when I searched over
the net I couldnt find anything. Any ideas about this please do let me know.

I want to create a page where I can upload an image using any upload
function and then display it.
Now after diplaying it I want to select the hotspots for an image map.
The coordinates of image map values are stored in a database.

Basically I want that to create image maps and hotspots I dont use any
offline software, this work is successfully completed and working perfectly, but i want generate one identification where i click the hot spots position in image or CSS file Generate for user identifications, So how can i solve this problem,please Help me.

I hope You are clear in that what I am looking for.

Please do reply if you have any sugestions.

Thanks In Advance:



Dynamically Generate hotspots With one identification like image or CSS in Image map


Hi One And All,

              Here I am write one query please help to me.

Query:how to Dynamically Generate Hotspots On image map with identification like image or CSS this logic for admin side ,and this image is Display in Front end side with Hotspots  using asp.net and c#.

I hope this understand one and all,

Thanks In Advance.

Adding an Image to a StackPanel dynamically


I feel silly asking this, but so far I haven't been able to solve this problem by myself, so here goes.

I'm trying to dynamically add a StackPanel to a Canvas, which works, but I also need to add an Image to the same StackPanel, which does not yet work. My code for this looks like this:

public void CreateInfo()
  StackPanel info = new StackPanel();
  TextBlock authorBlock = new TextBlock();
  TextBlock extraBlock = new TextBlock();

  info.Height = 500;
  info.Width = 500;

  authorBlock.Text = "Some text to test.";

  System.Windows.Controls.Image img = new System.Windows.Controls.Image(); // I needed to disambiguate Image.
  img.Source = new BitmapImage(new Uri("/Trex;component/Resources/icons/fire.png", UriKind.RelativeOrAbsolute)); // fire.png is something like 24 x 44 pixels.

  Canvas.SetLeft(info, 100);

dynamically change the background image of a


I have created an asp.net website using visual studio express 2008.  I am having trouble mapping a path to my image folder from other files in the website.

My image folder's path is http://localhost/Cafeteria/Image/MyImage.gif

My aspx page that I want to map from is http://localhost/Cafeteria/Submeals/burgers.aspx

In my /burgers.aspx I have the following code:


<asp:content id="Content1" contentplaceholderid="Main" runat="server"><

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:


Image Color Change Dynamically on the fly, is it possible?


Hey All,

I have created an aspx page that is displaying user profiles, and on that page I have an asp.net image control that I dynamically populate at runtime based on the users profile image.

I have created several themes, just modifying css to display the profiles with different background and different layouts.

For fun I have created one theme that is kind of like the matrix, and I would like to be able to take the users profile image and change it to a 'green scale' so to speak, or even just a straight up green color, more so this one #20f380. The profile images are just jpg, and are already cartoonish so they should change to green without the image looking to bad.

Is there a way to use code behind to change an image's colors?

C# or VB is fine, currently I've not been able to find any tutorials that work for me, or are close to what I am trying to do.

Dynamically Changing ImageUrl in HyperLink control


Hey guys,

C#/.net newb alert. ;)

I'm writing a script and need help with being able to modify the ImageUrl property in a HyperLink control from the code behind page. It is meant to dynamically show an image.

I just need to know the correct format of the code behind to get this to work.


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?????


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