Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3980998
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:21:26+00:00 2026-05-20T05:21:26+00:00

i am using .net 2.0. I have 2 images both relate to one a

  • 0

i am using .net 2.0. I have 2 images both relate to one a nother. They work like how an accordin works. what is happening is that i have a list with one image on the list. When i click on the first list button the first list expnads and the second list hides and at the same time the button on the second list needs to change. but the button on the second list doesnt change. The button on the first list works fine its just the button on the secon list stays the same all the time when i click on any of the buttons.

The problem lies when i want to set the src of the button to change respective of which button is clicked. Here is the code 1 in vb.net and the javascript.

Dim divUserPageMediaUrlChooser As New Div
divInnerContainer.Controls.Add(divUserPageMediaUrlChooser)
divUserPageMediaUrlChooser.CSSClass = "divuserpagemediachooseurlyoutube"

Dim imageYoutubeUrlChooser As New Image
divUserPageMediaUrlChooser.Controls.Add(imageYoutubeUrlChooser)
imageYoutubeUrlChooser.CssClass = "imageupselectormedia"
imageYoutubeUrlChooser.ImageUrl = "images/userhomepage/upselector.png"

Dim divUserPageMediaUrlChooserText As New Div
divUserPageMediaUrlChooser.Controls.Add(divUserPageMediaUrlChooserText)
divUserPageMediaUrlChooserText.CSSClass = "divuserpagemediachooseurlyoutubetext"
divUserPageMediaUrlChooserText.InnerText = "Upload media via URL"

Dim divYoutbeMediaSelectorContainer1 As New Div
divInnerContainer.Controls.Add(divYoutbeMediaSelectorContainer1)
divYoutbeMediaSelectorContainer1.CSSClass = "divyoutubemediaselectorcontainer1"

Dim divUserPageMediaYoutubeChooserSeperator As New Div
divInnerContainer.Controls.Add(divUserPageMediaYoutubeChooserSeperator)
divUserPageMediaYoutubeChooserSeperator.CSSClass = "divuserpagemediachooseyoutubesperator"

Dim divUserPageMediaUrlChooser2 As New Div
divInnerContainer.Controls.Add(divUserPageMediaUrlChooser2)
divUserPageMediaUrlChooser2.CSSClass = "divuserpagemediachooseurlyoutube"

Dim imageYoutubeUrlChooser2 As New Image
divUserPageMediaUrlChooser2.Controls.Add(imageYoutubeUrlChooser2)
imageYoutubeUrlChooser2.CssClass = "imageupselectormedia"
imageYoutubeUrlChooser2.ImageUrl = "images/userhomepage/downselector.png"

Dim divUserPageMediaSearchChooserText As New Div
divUserPageMediaUrlChooser2.Controls.Add(divUserPageMediaSearchChooserText)
divUserPageMediaSearchChooserText.CSSClass = "divuserpagemediachooseurlyoutubetext"
divUserPageMediaSearchChooserText.InnerText = "Upload media via searching Youtube"

Dim divYoutbeMediaSelectorContainer2 As New Div
divInnerContainer.Controls.Add(divYoutbeMediaSelectorContainer2)
divYoutbeMediaSelectorContainer2.CSSClass = "divyoutubemediaselectorcontainer2"


imageYoutubeUrlChooser.Attributes.Add("onmousedown", String.Format("SelectYoutubeChoose('{0}','{1}','{2}','{3}','{4}')", imageYoutubeUrlChooser.ClientID, divYoutbeMediaSelectorContainer1.ClientID, divYoutbeMediaSelectorContainer2.ClientID, imageYoutubeUrlChooser.ClientID, imageYoutubeUrlChooser2.ClientID))
imageYoutubeUrlChooser2.Attributes.Add("onmousedown", String.Format("SelectYoutubeChoose('{0}','{1}','{2}','{3}','{4}')", imageYoutubeUrlChooser2.ClientID, divYoutbeMediaSelectorContainer1.ClientID, divYoutbeMediaSelectorContainer2.ClientID, imageYoutubeUrlChooser.ClientID, imageYoutubeUrlChooser2.ClientID))

Javascript

function SelectYoutubeChoose(theId, id1, id2, imageId1, imageId2) {

  var theImage = $("#" + theId);
  var container1 =  $("#" + id1);
  var container2 =  $("#" + id2);
  var image1 = $("#" + imageId1);
  var image2 = $("#" + imageId2);

  if (theImage.attr("id") == image2.attr("id"))
  {
    if ($(container2).css("display") == "block") {

      $(container1).show();
      $(container2).hide();
      $(image2).attr("src", "images/userhomepage/upselector.png");
      $(image1).attr("src", "images/userhomepage/downselector.png");
      //            document.getElementById(imageId2).src = "images/userhomepage/upselector.png";
      //            document.getElementById(imageId1).src = "images/userhomepage/downselector.png";

    }
    else {
      $(container1).hide();
      $(container2).show();
      $(image2).attr("src", "images/userhomepage/downselector.png");
      $(image1).attr("src", "images/userhomepage/upselector.png");
    }
  }

  if (theImage.attr("id") == image1.attr("id")) {
    if ($(container1).css("display") == "block") {

      $(container1).hide();
      $(container2).show();
      $(image2).attr("src", "images/userhomepage/downselector.png");
      $(image1).attr("src", "images/userhomepage/upselector.png");

    }
    else {
      $(container1).show();
      $(container2).hide();
      $(image2).attr("src", "images/userhomepage/upselector.png");
      $(image1).attr("src", "images/userhomepage/downselector.png");
    }
  }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:21:27+00:00Added an answer on May 20, 2026 at 5:21 am

    You may wish to consider using CSS backgrounds and simply swapping class names. Much cleaner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using visual studio 2008 coding asp.net.vb I have 20 images on my
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
I have an ASP.NET application that implements keep-alive by using a hidden IFRAME with
sending mail along with embedded image using asp.net I have already used following but
I'm using ASP.NET MVC and have a model which has an image (byte array)
Using the .net framework you have the option to create temporary files with Path.GetTempFileName();
I'm using .NET 3.5 and I have a class, A, marked as internal sealed
I have previously written user interfaces using .NET and Windows Forms. I'm about to
I am using vb.net language I have a dropdownlist, which is filled by below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.