JeremyK
JeremyK

Reputation: 1103

ASP.NET Chart crashing on server side

EDIT: After debugging and testing it was confirmed to be an issue with the Chart, not the panel resize.

I have this on the control's page:

<td><asp:Button ID="btn_Details" runat="server" Text="Show Details" OnClick="btn_Details_Click" /></td>

The code behind the scenes is as follows:

protected void btn_Details_Click(object sender, EventArgs e)
{
    ToggleDetails();
}
void ToggleDetails()
{
    if ((bool)ViewState["bShowingDetails"] == true)
    {
        Panel1.Height = 60;
        btn_Details.Text = "Show Details";
        ViewState["bShowingDetails"] = false;
        ChartPanel.Visible = false;
    }
    else
    {
        Panel1.Height = 400;
        btn_Details.Text = "Hide Details";
        ViewState["bShowingDetails"] = true;
        UpdateGraph();
        ChartPanel.Visible = true;
    }
}

The control is contained on an UpdatePanel on the main page. I have other elements on that control that are updating without any issues. But for some reason the button click handler is not re-sizing as expected. If I add code into the handler to hide the control, it will disappear. So I know the handler is running and not throwing any exceptions.

Any ideas why the control won't resize on the server?

Images of what it does on local machine: Prior to click Expanded

EDIT: The console output is spitting out this error when I try to click:

Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

Upvotes: 0

Views: 232

Answers (1)

JeremyK
JeremyK

Reputation: 1103

Turns out the Chart was looking for a folder on the server that did not exist. Once I created the folder on the C drive the error went away.

See this question: Invalid temp images directory in chart handler configuration

Upvotes: 1

Related Questions