|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/24/2008 3:52:04 PM
Posts: 10,
Visits: 45
|
|
| 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 anel 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 anel> </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
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/24/2008 3:52:04 PM
Posts: 10,
Visits: 45
|
|
| sorry, there are 2 'smiley' faces in my code!!! Don't know how to disable that. Both should be the ASP : Panel tag.
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 11:36:12 PM
Posts: 627,
Visits: 1,915
|
|
Hi cawthor, You can write this program using ajax postback of chart as well as the XML. I have modified your program. I am using here ICallbackEventHandler as implement. Now modal popup is working perfectly. Could you please try and apply it in your code and give us your valuable feedback?
Thanks,
Arindam FusionCharts Team
www.fusioncharts.com
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/24/2008 3:52:04 PM
Posts: 10,
Visits: 45
|
|
| Thank You! This works perfectly! I can't say I fully understand 'how' this works, I'm slightly confused as to what is happening in the following lines of code. But thanks once again! [code] ' Ajax Control Adding Dim cm As ClientScriptManager = Page.ClientScript Dim cbReference As String = cm.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "context") ' Add Javascript on page Dim callbackScript As String = "function CallServer(arg, context)" + "{" + cbReference + "; }" cm.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True) [\code]
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 11:36:12 PM
Posts: 627,
Visits: 1,915
|
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 8/11/2008 3:44:38 PM
Posts: 10,
Visits: 39
|
|
Is there a copy of the ModalPopUP_code.zip for C#. If there is can you please e-mail it to me, because I cannot read the attachment here.
Thanks,
Matt
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 11:36:12 PM
Posts: 627,
Visits: 1,915
|
|
|
|
|
| | |