I've added a chart to my ASP .NET page, and made the chart a hotspot via the 'clickURL' property. When the user clicks the chart, I want to display a larger version in an AJAX Modal popup. This works fine in IE7, but won't work correctly in IE6. The pop-up appears but says 'No Data to display'. If I then hit F5 (refresh), it works fine (until I post-back then it's back to 'no Data...' and F5 to make it work again). I've pasted some test code below which works fine in IE7, but the above issue in IE6. Is there another way I can achieve this...or am I doing something incorrect? Thanks.
default.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<SCRIPT LANGUAGE="Javascript" SRC="/FusionCharts/Includes/FusionCharts.js"></SCRIPT>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<title></title>
<script>
function showModal() {
var strURL = "modalChart.aspx";
strURL = escape(strURL);
var chartObj = getChartFromId("modalChart");
chartObj.setDataURL(strURL);
$find("ModalPopupExtender1").show();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true" EnableScriptLocalization="true" ID="ScriptManager1" />
<center>
<%=GetChartHtml()%>
</center>
<div style="display:none; visibility:hidden;">
<asp:Button runat="server" ID="hiddenButton" />
</div>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="hiddenButton" PopupControlID="PNL" OkControlID="ButtonOk" />
<asp:Panel ID="PNL" runat="server" style="width:800px; height:500px; background-color:White; border-width:2px; border-color:Black; border-style:solid; padding:6px;">
<center>
<%=GetModalChartHtml()%>
<br />
<asp:Button ID="ButtonOk" runat="server" Text="OK" />
</center>
</asp:Panel>
</form>
</body>
</html>
default.aspx.vb
Imports System.Data
Imports System.Data.SqlClient
Imports InfoSoftGlobal
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Partial Class _Default
Inherits System.Web.UI.Page
Public Function GetChartHtml() As String
Dim xmlData As StringBuilder = New StringBuilder()
xmlData.Append("<chart clickURL='javascript:showModal()' decimals='2' labelstep='2' imageSave='1' drawAnchors='1' anchorAlpha='100' slantLabels='1' borderAlpha='100'><categories>")
xmlData.Append("<category label='7/23/2008' />")
xmlData.Append("</categories>")
xmlData.Append("<dataset>")
xmlData.Append("<set value='100' />")
xmlData.Append("</dataset></chart>")
Return FusionCharts.RenderChart("/FusionCharts/Charts/MSColumn3d.swf", "", xmlData.ToString(), "test", "435", "228", False, True)
End Function
Public Function GetModalChartHtml() As String
Return FusionCharts.RenderChart("/FusionCharts/Charts/MSColumn3d.swf", "", "<chart></chart>", "modalChart", "760", "425", False, True)
End Function
End Class
modalChart.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="modalChart.aspx.vb" Inherits="modalChart" %>
modalChart.aspx.vb
Imports System.Data
Imports System.Data.SqlClient
Partial Class modalChart
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim xmlData As StringBuilder = New StringBuilder()
xmlData.Append("<chart decimals='2' labelstep='2' imageSave='1' drawAnchors='1' anchorAlpha='100' borderAlpha='100'><categories>")
xmlData.Append("<category label='7/24/2008' />")
xmlData.Append("</categories>")
xmlData.Append("<dataset>")
xmlData.Append("<set value='200' />")
xmlData.Append("</dataset></chart>")
Response.ContentType = "text/xml"
Response.Output.Write(xmlData.ToString())
End Sub
End Class