Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    63
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Which element caused postback?

    Hi,

    I am currently creating a .ascx file to make my own user control which will display images and works something like a dropdownlist. When user select the image, the selected image will be selected just like the dropdownlist. I will create the <input type="image"> for each image file in the specified folder. Which makes my user control dynamic.

    I have 2 labels called: lblAll and lblDisplay. lblDisplay: Shows the selected image and lblAll: shows the rest of the remaining images. The <input type="image"> will be placed inside the lblAll and lblDisplay. I have used the <div> tags to expand and collaspe the labels accordingly.

    The reason i decided to use <input type="image"> is because i would like a postback so that i can update the newly selected image.

    My problem: How am i supposed to know which <input type="image"> was clicked/selected during postback? Thanks

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Here is a demo that uses HtmlInputImage, which is what you're talking about. That uses a couple of different images, so you can see which one triggered the postback. Hope it helps.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    63
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi,

    This link is fantastic! Thank you, im sure it will help me a lot. Thanks again!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •