Is it possible to access java script data from the code behind in a different page?
<p>I am trying to export some data that I have in some Backbone collections to a csv file. </p>

<p>So far I am opening a new export page using java script like so </p>

<pre><code>                var href = [];    
                href.push('ExportAnalysis.aspx?');
                href.push('ParamSet=' + this.document.analysisParameterSetView.selectedParamSet + '&amp;');
                href.push('Start=' + start

Date + '&amp;');
            href.push('Finish=' + endDate + '&amp;');
            frames["exportIFrame"].location.href = href.join('');
</code></pre>

<p>And then in the code behind of exportAalysis.aspx, i am grabing the variables from the query string getting the data, building up the csv file and return the file like so. </p>

<pre><code>  // Get the export parmaters from the query string
        var paramSet = Request["ParamSet"];
        var startUnix = int.Parse(Request["Start"]);
        var finishUnix = int.Parse(Request["Finish"]);
        var start = DateTime.Parse("1970-01-01").AddSeconds(startUnix);
        var finish = DateTime.Parse("1970-01-01").AddSeconds(finishUnix);

        // GET DATA using Parameters

        var filename = "analysisExport";
        var content = "1,2";

        Response.Clear();
        Response.ContentType = "application/x-unknown";
        Response.AddHeader("Content-Disposition", "attachment;filename=" + filename);
        Response.Write(content);

        Response.End();
    }
</code></pre>

<p>This works OK, but it seems a little inefficient, as I am having to get the data I need twice. Once for the main page and again for the export page. </p>

<p>Its a bit of a long shot But is it possible to get the data from the first page from the code behind of the export page? If it was all client side I could use window.opener.document to get the opener page, Can I do something similar in asp.net</p>

<p>Or am I completely off track, and there is a much better way to achieve this. </p>
