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

  • SEARCH
  • Home
  • 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 392973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:12:43+00:00 2026-05-12T16:12:43+00:00

I have the below code in a .ascx file as part of an asp.net

  • 0

I have the below code in a .ascx file as part of an asp.net project. How can I write the JavaScript to change the image source to a gif?

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Steps123.ascx.cs" Inherits="SwintonTaxiWeb.UserControls.Steps123" %>

<div id="slickShow">

    <div class="<%=stepOneDivClass %>">
            <asp:ImageButton runat="server" ID="GetQuote" 
                CssClass="imgBut swapImage {src: '/images/Quote-Oval-button-(roll-over).png'}"
                ImageUrl="/images/Quote-Oval-button.png" AlternateText="Get Quote" TabIndex="1" />
    </div>
    <div id="rollOver">
        <img src="/images/Roll-over-to-view-steps-two-and-three.png" alt="Roll over to view steps 2 and 3" />
    </div>
    <div id="slideContainer">
        <div class="step-two">
            <asp:ImageButton runat="server" ID="GetCallback" 
                CssClass="swapImage {src: '/images/Call-back-button-(roll-over).png'}" 
                ImageUrl="/images/Call-back-button.png" AlternateText="Get Callback" Width="69" 
                Height="44" TabIndex="2" />
        </div>
        <div class="step-three">
            <fieldset>
                <asp:TextBox CssClass="postcode" ID="postcode" runat="server" TabIndex="0" /><asp:ImageButton runat="server" 
                    ID="go" CssClass="go" ImageUrl="/images/Go-button.png" AlternateText="Go" onclick="Go_Click" TabIndex="1" />
            </fieldset>      
        </div>
    </div>
</div>
  • 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-12T16:12:43+00:00Added an answer on May 12, 2026 at 4:12 pm

    Using just JavaScript you could do:

    var image = document.getElementById('ctl00_MainContent_tester_GetQuote');
    image.src = [path to gif];
    

    You could also use jQuery to grab the element via class (or some other selector if you want):

    var image = $('.[ClassOfImage]').attr('src', '[NewPathToGif]');
    

    I love the jQuery.

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

Sidebar

Related Questions

I have constructed an ASP.NET user control Box.ascx wtih the following code. <div id=divContent
I am using Javascript for my ascx control. I have 2 tables, one below
i have below code snippet in my legacy project DetachedCriteria subCriteria = DetachedCriteria.forClass(Employee.class); subCriteria.setProjection(Projections.distinct(Property.forName
I have below code in my vb.net application: <table cellspacing=0 cellpadding=0 border=0 style=border-collapse: collapse;
In my ascx markup, I have the below code that I am trying to
I have the following code in my Site.Master page of an almost empty ASP.NET
I have in many places in my ASP.NET project used the Session variable for
I have this page, shown below. In the ASCX file, the data is generated
I have below code: <a href=# id=@item.Id name=vote ><img src=/Content/images/021.png style=float:left alt= /></a> which
I have below code: class Program { static void Main(string[] args) { Task[] tasks

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.