Request.QueryString["Chart"] different to Session key
Posted: Thu Jun 28, 2012 2:59 pm
We are using charts with TempChart set to Session but we are having some trouble because even tought query string "Chart" value is WebChart1fe80d912884e1cd11792%16634764784090241001png but when accessed via Request.QueryString["Chart"] is transforming to an strange character and thus Session[chartName] is null.
Already checked in Session and a key "WebChart1fe80d912884e1cd11792634764784090241001png" does exist. The code we are using for GetChart.aspx is the recommended one:
Any hints?
Thanks!
Already checked in Session and a key "WebChart1fe80d912884e1cd11792634764784090241001png" does exist. The code we are using for GetChart.aspx is the recommended one:
Code: Select all
public partial class GetChart : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
// *************************************************************
// Code to retrieve Session saved streamed Charts to a WebForm.
// This code should be included if the WebChart 'UseStreams' property is set to True.
// *************************************************************
string chartName=Request.QueryString["Chart"];
if (Session[chartName]!=null)
{
MemoryStream chartStream = new MemoryStream();
chartStream=((MemoryStream)Session[chartName]);
Response.OutputStream.Write(chartStream.ToArray(),0,(int)chartStream.Length);
chartStream.Close();
Session.Remove(chartName);
}
}
}
Thanks!