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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:06:29+00:00 2026-06-19T01:06:29+00:00

I create a chart, and save it in the path server.mappath(/images/chart/chartname.png), and if I

  • 0

I create a chart, and save it in the path server.mappath(“/images/chart/chartname.png”), and if I go to the path, the image is there, and I can open it on my computer, but what I would really like to do is display the image on the page after I create it, preferably asynchronously. I’ve tried putting a asp:image control in the update panel and changing the url, but that doesn’t work. I’ve tried a bunch of different ways, if someone could point me to the right direction, that would be great. I won’t post any code simple because what I have so far IS working. Once I start attempting to print the image I’ll post snippets if I have answers.

Edit: Here is some code

The button event that starts the whole thing:

Protected Sub btnCreate_Click(sender As Object, e As EventArgs) Handles btnCreate.Click

    Dim worker As New backgroundWorker

    'Check input

    worker.RunWorker({})

    Session("worker") = worker

    Timer1.Enabled = True

End Sub

This starts the worker, which generates the chart fine, and starts the timer which is used to update the panel. Eventually in that code, this happens

Dim imgpath As String = Server.MapPath("images/chart/test.png")
chart.SaveImage(imgpath, ChartImageFormat.Png)
chartImg.ImageUrl = "~/images/chart/test.png"

Now, I know that the panel is being updated after this code is executed, because I output some messages to a multiline textbox, and they do appear. All these controls are also in the contentTemplate of the updatePanel.

  • 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-06-19T01:06:30+00:00Added an answer on June 19, 2026 at 1:06 am

    Setting the ImageUrl property of an ASP.Net image control, while within and update panel, should do the trick without having to use Javascript, although that method can be very efficient. UpdatePanels tend to be “heavy”, that is the ScriptManager, UpdatePanel, and ASP.Net ViewState tend to send a lot of information back and forth via their AJAX methods. You can see what I mean by using Fiddler to watch your web traffic.

    That being said, I was able to achieve the desired effect in the following manner. I have two static images, Image1.jpg and Image2.jpg, but it should work with your dynamically generated image, as long as the URL is correct.

    Here’s the text of my ASPX page:

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Image ID="Image1" runat="server" ImageUrl="~/Image1.jpg" Width="300"></asp:Image><br />
                <asp:Button runat="server" ID="btnSwitchImage" Text="Switch" />
            </ContentTemplate>
        </asp:UpdatePanel>
    
    </div>
    </form>
    

    And here is the code-behind:

    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load( object sender, EventArgs e )
        {
            btnSwitchImage.Click += new EventHandler( btnSwitchImage_Click );
        }
    
        void btnSwitchImage_Click( object sender, EventArgs e )
        {
            Image1.ImageUrl = "~/Image2.jpg";
        }
    }
    

    As long as the button and image controls are within the UpdatePanel’s ContentTemplate everything should be relayed via AJAX. Once again, use Fiddler to confirm this.

    If this example works for you but you still can’t get your application working try posting some code in your question. It might help everyone analyze the problem directly.

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

Sidebar

Related Questions

I'm trying to save my chart image so that I can put it into
I want to create a component which can be used like: <mc:chart data=#{bean.data} width=200
I am using DotNetCharting version 4.2. I am trying to create a chart, save
I try to set localization for standard save or open dialogs, but everything except
I am developing a application to create chart. I have two types of Queries.
This is the code in my view: echo $this->Form->create('Chart'); echo $this->Form->input('username', array('label'=>('Usernames List'), 'empty'=>('Select
I create Pie Chart in VS 2008 C# Project using Microsoft Office Interop Excel.
i need to create a chart similar to this: link text Do you have
I am trying to create a chart which has both actual data and the
I am trying to create a chart with PHP and GD. The chart is

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.