Need some help understanding Connection Refresh/XML Data Connection
I have an XML Data Connection on my Xcelsius Dashboard and a Connection Refresh button to trigger it. The XML Data Connection is tied to a Default.aspx with Default.aspx.cs code-behind.
Default.aspx has the following code, just something to send back to a single cell in the dashboard:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="screenshot._Default" %> <% //tester to see that script executes String sXML; sXML = "<data><variable name=" + '\u0022' + "Range_0" + '\u0022' + "><row><column>Script Executed</column></row></variable></data>"; Response.Write(sXML); %>
Default.aspx.cs does the following:
The code-behind takes a screenshot of the dashboard and opens the Outlook email client with that screenshot already attached. From here the user can fill out To, Subject, and Body and then send the email. The code to do all of this is located in (might this be the cause?):
protected void Page_Load(object sender, EventArgs e)
All of this works and it works well. But it only works 1 time. After the 1st execution of the code-behind if i adjust my dashboard and click the Connection Refresh button a 2nd time, nothing happens. No screenshot is generated and no Outlook email pops up. In order to send an additional screenshot I would need to close the dashboard and reopen it. I'd imagine there is a way for my Connection Refresh button to execute the Default.aspx and its code-behind each time the button is clicked, but I am still learning about the functionality of this feature.
My Connection Refresh button and XML Data Connection are not set to "Refresh Before/After components are loaded" and neither one is tied to a trigger cell. I don't believe using either of these options would solve my problem, but you may see or know something I don't.
Any help or explanation would be greatly appreciated! If any additional information is needed please let me know. Thanks!
David Gilbertson replied
Glad to see your e-mail solution is coming along nicely!
I think your problem may be because of the way IE/flash caches calls to external objects. You may need to add "?rand()" to the end of the URL (after .aspx).
Here's a Ryan Goodman post explaining it: http://ryangoodman.net/blog/index.php/2008/06/20/xml-maps-best-practices-for-xcelsius-2008
You may need some other logic to make sure that the RAND function is triggered to update.