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 633645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:12:32+00:00 2026-05-13T20:12:32+00:00

I have a wizard control inside an updatepanel. Some of the wizard steps take

  • 0

I have a wizard control inside an updatepanel. Some of the wizard steps take a few seconds to display, so I want to show an updateprogress control while they’re loading. This is working, but I’d like to show a different image (random image selected from a folder) in the progresstemplate between each wizardstep.

I am able to access the image control and change the ImageUrl, but the progresstemplate never updates. It retains the first random image chosen from the very first time it loads.

I’ve tried updating the imageUrl on PageLoad and also by overriding the Render() method, but neither works.

<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="500" >
    <ProgressTemplate>
        <div class="modalWrapper">
            <div class="updateProgress">
                <asp:Image ID="imgLoading" runat="server" AlternateText="Loading..." />
            </div>
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>

In codebehind:

protected void Page_Load(object sender, EventArgs e)
{
 System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)UpdateProgress1.FindControl("imgLoading");

    if (img != null)
        img.ImageUrl = PickImageFromDirectory("~/images/loaders/"); //returns "~/images/loaders/randomimage.gif"  
}

ALSO TRIED:

protected override void Render(HtmlTextWriter writer)
    {          
        System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)UpdateProgress1.FindControl("imgLoading");

        if (img != null)                       
            img.ImageUrl = PickImageFromDirectory("~/images/loaders/"); //returns "~/images/loaders/randomimage.gif"

        base.Render(writer);
    }
  • 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-13T20:12:33+00:00Added an answer on May 13, 2026 at 8:12 pm

    Your image is more than likely not being reloaded because the UpdateProgress sits outside your UpdatePanel. The nature of the UpdatePanel is that only the controls within it are updated on an asynchronous request. =)

    Here’s what you can do:

    Change PickImageFromDirectory to be a static method and mark it as a WebMethod in the code-behind:

    [WebMethod]
    public static string PickRandomImage()
    {
       // Logic to return the full path to a random image
    }
    

    Then, on the client-side place the following script at the bottom:

    <script type="text/javascript">
    function requestEnded()
    {
       PageMethods.PickRandomImage(imageSuccess, imageFailed);
    }
    
    function imageSuccess(result,ctx,methodName)
    {
      document.getElementById('<%= imgLoading.ClientID %>').src = result;
    }
    
    function imageFailed(err,ctx,methodName)
    {
      alert(err);
    }
    
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(requestEnded);
    </script>
    

    After every asynchronous postback this will call your server-side web method and set the image src to a random url. =)

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

Sidebar

Related Questions

Here is a code snippet for an asp:Wizard control I have on an aspx
I want to build a shop in which the products have a little wizard
I have created a wizard form and each page of the form will display
I have a Wizard control with one of the pages containing a FileUpload control.
I have a wizard control. When someone clicks a button within the wizard control
Good Afternoon All, I have a wizard control that contains 20 textboxes for part
I have a asp:Wizard control on a site running Framework 3.5. I acquired the
We have several wizard style form applications on our website where we capture information
I have an app that I'm writing a little wizard for. It automated a
I have a wizard style interface where I need to collect data from users.

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.