PDA

View Full Version : asp.net Imagemap dynamic url?


dajohnson1s
04-23-2008, 09:30 AM
Hello,

I have generated a bunch of images that I want to use as part of my image map. The problem is these images are stored as location number + date needed the .gif --->(17504062008.gif) I know 100% that the path and the image name are being build correctly.

I am taking my newly created image name and making it a string:
dim name As String
name = path + loc + date + ".gif"

but I want to take the "name" and assign it to the imageurl of the image map:
<asp:...imageurl=name... />

I can currently do this: (with an asp:image.../>)
imageid.ImageUrl = name

This works exactly how I would like for the image map. (I have tried this for the image map, but it complains when I remove the imageurl from the<asp:.../>)

any help I would be very greatful.
Thanks

chump2877
04-23-2008, 02:18 PM
this works fine for me (with no errors in Visual Studio):

.aspx file
<asp:ImageMap ID="ImageMap1" runat="server" ImageUrl="">
</asp:ImageMap>

.cs file (or vb in your case)
protected void Page_Load(object sender, EventArgs e)
{
ImageMap1.ImageUrl = "images/header.jpg";
}

Loads "header.jpg" on page load. I left the ImageUrl attribute in the .aspx file with no value.

jleone
04-23-2008, 06:48 PM
Why would you want to remove imageurl, and how are you removing it? It may be helpful to post your portion of the code in question.