image object change according to what button is clicked on a menu.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: image object change according to what button is clicked on a menu.

  1. #1
    Join Date
    Sep 2006
    Posts
    7

    Question image object change according to what button is clicked on a menu.

    Hello All, I'm pretty new to ASP.NET. I'm designing an intranet site for our orginization. I'm not too familiar with menu controls. I need to know if there is a way to change an image object to a different .gif, depending on what menu button was clicked. Example: I click on the menu item Administration which is tied to a img url. The current page that I am on, has a .gif for the corporate page, but when the Administration button is clicked and redirects to the default.aspx?id=Admin, I need the .gif file to change to the Admin banner. Help Please!

    Please refer to example jpg attached.
    Attached Images Attached Images
    Last edited by mikester20; 09-13-2006 at 07:34 PM.

  2. #2
    Join Date
    Jun 2004
    Location
    Pakistan
    Posts
    292
    How about putting all images in that directory and name them based on your section name. So you would have something like this (if just using IMG):
    Code:
    <img src="/imagefolder/<%=Request.QueryString("Id")%>.JPG" />
    Of course you can replace that REQ with either a literal or make that image a .NET image.

    If I am getting it all wrong, and you want to do it without the postback, use JavaScript.
    new to programming but getting ther

  3. #3
    Join Date
    Sep 2006
    Posts
    7
    How would I use the Request.QueryString syntax using an ASP:Image control?

  4. #4
    Join Date
    Jun 2004
    Location
    Pakistan
    Posts
    292
    You can't but you can control the ImageURL attribute through code behind/script. Give it an ID and then set the ImageURL = "/imagefolder/" & Request.QueryString("Id") & ".jpg"
    And as I mentioned before, the names of sections and images should be the same (this is to avoid long select statements and of course so that image shows up). Also keep them in a separate folder to avoid confusion and keep the directory structure clean.
    new to programming but getting ther

Similar Threads

  1. Replies: 1
    Last Post: 09-08-2005, 02:23 PM
  2. Form Upload - Image to replace browse button
    By AC7117 in forum Architecture and Design
    Replies: 0
    Last Post: 03-20-2002, 10:49 AM
  3. Validating XML
    By Jaco de Villiers in forum XML
    Replies: 1
    Last Post: 06-01-2001, 06:50 PM
  4. HTML submit vs. image button
    By colsen in forum Architecture and Design
    Replies: 1
    Last Post: 05-25-2001, 03:03 PM
  5. HTML submit vs. image button
    By colsen in forum Architecture and Design
    Replies: 0
    Last Post: 05-22-2001, 12:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center