473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Changing the imageurl of an imagemap control upon postback

Is there a way to change to swapimages for an imagemap in asp.net upon
postback on the server?

Thanks!
Feb 15 '08 #1
1 1860
Try something like the following:

If Me.Image1.ImageUrl = "images/image1.gif" Then Me.Image1.ImageUrl =
"images/image2.gif" Else Me.Image1.ImageUrl = "images/image2.gif"

It is important to make sure EnableViewState is set to True so that you can
determine the currently displayed ImageUrl. If you have more than one image
you want to loop through, you will need to modify the algorithm a little,
but the key is looking at the currently displayed ImageUrl. Another approach
would be to use a HiddenField control to keep track of the currently
displayed image, but this requires an extra control, so it is probably less
efficient.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"BillGatesFan" <kl******@hotmail.comwrote in message
news:d1**********************************@i7g2000p rf.googlegroups.com...
Is there a way to change to swapimages for an imagemap in asp.net upon
postback on the server?

Thanks!

Feb 15 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Scott P. | last post by:
I'm creating an app using ASP .NET (my second app so bear with me here) that basically builds a PDF file based on a bunch of user selections. I have a page which displays a series of checkboxs...
1
by: Henke | last post by:
Hello, I have one ImageButton controls which I initialize in Page_Load and declare on class level. ImageButton save = new ImageButton(); save.ImageUrl = "save.gif" save.Click += new...
6
by: Adrian Parker | last post by:
I have a form with some controls on it, one of them has an auto postback onchange. So the postback occurs but before the event fires, all the controls are recreated. so my question is, if the...
1
by: Nathan Sokalski | last post by:
I am using the ImageUrl property of the Hyperlink control to create a graphical Hyperlink. However, I want to change the size of the image I am using, but the generated HTML places the width/height...
9
by: Nathan Sokalski | last post by:
I am using ASP.NET 2.0's ImageMap Control to create 2 imagemaps, one directly below the other. When I do this a thin blank space appears between them. After several days of frustration I realized...
1
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the Width of the ImageMap below. The problem is that the ImageMap's Width doesn't have any effect in my GridView, the width are determine by width of the...
1
by: wardemon | last post by:
Hi, I have an image control which inside an ItemTemplate of a GridView Control. I've coded the ImageControl's ImageURL in "Source" to have a dynamically filled-up value ex: ImageURL = <%#...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
0
by: DamienS | last post by:
Hi, I have a situation where I have custom user controls 'cut out' of the background image of a master page. Basically, I've used photoshop to export a sliced image which is used in the master...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.