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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:17:19+00:00 2026-05-27T22:17:19+00:00

I’ve been working on a small application recently which consists of an index page

  • 0

I’ve been working on a small application recently which consists of an index page containing a few reports run off a database, and then some forms to update the content of that page, all within ASP.NET using C#, in order to learn how to use MSCharts in future.

The index page can display any of 5 reports I have set up, chosen via a drop down box. By default, the first is selected such that there should always be a chart showing on the page.

I got the charts functioning and showing what I wanted them to on the index page fine , and the forms to update the database did their job too. However, when I clicked the “exit” button on one of these pages (which sent the user back to the index page), the chart that should have been displayed there was simply a red “x”, as if the image did not exist. If I refreshed the page it appeared as it should do.

The Exit buttons at the time used Response.Redirect() to send the user back to the index page, and I spent some time confirming this was the correct method. In the end, I tried switching to use of Server.Transfer() instead, despite every site seeming to indicate that there was no major difference between the two in terms of the page execution cycle – only that Response.Redirect() sent a whole new request whereas Server.Transfer didn’t.

Despite all that, though, using Server.Transfer() fixed the issue. Well, that’s great!

Can anyone explain why this worked?

Update – Some code, in case it helps at all.

One of the events in question from the update forms – originally used Response.Redirect() of course.

    protected void Exit_Click(object sender, EventArgs e)
    {
        Server.Transfer("Default.aspx");
    }

The Page_Load from Default.aspx:

    protected void Page_Load(object sender, EventArgs e)
    {
        Report report = new Report(reportList.SelectedIndex);
        ChartPanel.Controls.Add(report.Chart);
    }

Outline of the Report class – this is basically a wrapper for the various reports I have specified in the createChartFromParameters() method. It simply does all the work of setting up the chart so it doesn’t end up in the UI, and then lets the UI take the chart object itself. I can post the implementation if someone would find it useful, but it’s ugly as anything and really quite long-winded, so I’d rather not.

public class Report
{
    private Chart chart { public get; }

    public Report(string title, string command, string x, string y, string label, string legend, SeriesChartType type)

    public Report(int presetChartNum)

    private void createChartFromParameters(string title, string command, string x, string y, string label, string legend, SeriesChartType type, int customcode = 0)  
}
  • 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-27T22:17:19+00:00Added an answer on May 27, 2026 at 10:17 pm

    I believe this is a misunderstanding of how the server object and response object perform the redirection

    It has a lot to do with how the client is redirected to the new resource and from what end it does so, and what objects it has access to afterwards.

    I could type it all out but there is a good resource here.

    http://techahead.wordpress.com/2007/10/14/aspnet-servertransfer-vs-responseredirect/

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

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I would like to run a str_replace or preg_replace which looks for certain words
I have an array which has BIG numbers and small numbers in it. I
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have an autohotkey script which looks up a word in a bilingual dictionary

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.