Changing the imageurl of an imagemap control upon postback

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BillGatesFan

    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!
  • Nathan Sokalski

    #2
    Re: Changing the imageurl of an imagemap control upon postback

    Try something like the following:

    If Me.Image1.Image Url = "images/image1.gif" Then Me.Image1.Image Url =
    "images/image2.gif" Else Me.Image1.Image Url = "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
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。


    "BillGatesF an" <klj_mcsd@hotma il.comwrote in message
    news:d1fcd50f-bcfc-4ef3-8d76-009faf4557de@i7 g2000prf.google groups.com...
    Is there a way to change to swapimages for an imagemap in asp.net upon
    postback on the server?
    >
    Thanks!

    Comment

    Working...