Oops Posted April 24, 2007 Report Share Posted April 24, 2007 I am trying to implement a functionality wherein if the user clicks on a chart in the webpage, a new webpage opens up with an expanded version of the chart. Now my code looks like this MemoryStream mm = new MemoryStream(); ((Chart)PreviousPage.FindControl("Chart1")).Export(mm); Chart2.Import(mm ); But when i run this i get a exception like so : System.IndexOutOfRangeException was unhandled by user code Message="Index was outside the bounds of the array." Source="ChartFX.WebForms" at the 3rd line where i do the import. Can anyone help in pointing out what might be wrong here. Thanks. Quote Link to comment Share on other sites More sharing options...
Frank Posted April 24, 2007 Report Share Posted April 24, 2007 After export, the position in the stream is at the end of it, that's the reason Import fails. you need to do: mm.Position = 0; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.