cawthor Report post Posted July 23, 2008 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 Share this post Link to post Share on other sites
cawthor Report post Posted July 23, 2008 sorry, there are 2 'smiley' faces in my code!!! Don't know how to disable that. Both should be the ASP : Panel tag. Share this post Link to post Share on other sites
Arindam Report post Posted July 24, 2008 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? ModalPopUP_Code.zip Share this post Link to post Share on other sites
cawthor Report post Posted July 24, 2008 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! ' Ajax Control AddingDim cm As ClientScriptManager = Page.ClientScriptDim cbReference As String = cm.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "context")' Add Javascript on pageDim callbackScript As String = "function CallServer(arg, context)" + "{" + cbReference + "; }"cm.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True)[code] Share this post Link to post Share on other sites
Arindam Report post Posted July 25, 2008 Hi cawthor, Thank you for your feed back. For this code you can visit Microsoft MSDN. Please follow that link http://msdn.microsoft.com/en-us/library/ms178208(VS.80).aspx Share this post Link to post Share on other sites
hybridmatt Report post Posted July 28, 2008 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 Share this post Link to post Share on other sites
Arindam Report post Posted July 29, 2008 Please right click on attachment and after that Save target as and save it Share this post Link to post Share on other sites
hybridmatt Report post Posted July 29, 2008 Do you have a C# version of that code? I know VB and C# are both .NET but I am unfamiliar with VB. If you have done a C# version of the modal pop-up can you please post that code. Thanks, hybridmatt Share this post Link to post Share on other sites
Arindam Report post Posted July 30, 2008 modal pop-up C# Code ModalPopUP_C#_Code.zip Share this post Link to post Share on other sites
srvjith Report post Posted September 21, 2008 Hi, We have the same issue and is very critical part of our product. The attachment goes to some other page and am unable to download. Can you please reattach the zip file or post the fix in forum. Thanks, Sarva Share this post Link to post Share on other sites
Arindam Report post Posted September 22, 2008 Hi,Could you please right click on attachment and after that Save target as and save it? Share this post Link to post Share on other sites
jas Report post Posted May 1, 2009 I am experiencing the same issues as the previous posters of this blog. I also would like a copy of the C# code that is referenced, but I am also unable to download it. Right clicking the attachment ( ModalPopUP_C#_Code.zip) and selecting Save As only saves a web page (forum.html) and not a zip file containing C# code. Could you provide me with a place where I can download this C# package? Thanks in advance! Share this post Link to post Share on other sites
Dhruva Report post Posted May 4, 2009 I just checked, the d/l link seems to be working. Could you please try downloading the file from IE? Share this post Link to post Share on other sites
Kishoreb Report post Posted July 17, 2012 I'm unable to make it work for master page scenario. The following event is not firing in master/content page scenario. javascript:CallServer(%26apos;Fact1%26apos;,%26apos;%26apos;); Same coding setup works if it is without master page setup. Share this post Link to post Share on other sites
Guest Sumedh Report post Posted July 20, 2012 Hi, Refer this post: http://forum.fusioncharts.com/topic/12134-master-page-modal-popup-extender-drill-down-chart/page__pid__47872#entry47872 Share this post Link to post Share on other sites