Link to home
Start Free TrialLog in
Avatar of donrueter
donrueter

asked on

Using PostbackURL and AJAX

I have an ASP.Net/AJAX page named ViewLoads that is a fairly complex collection of updatepanels, multiviews, and controls of all kinds. It's working great.

Now I have added a control (cmdExportCampusTotals) which really has no code but has PostBackURL set to ~/GenerateFile.aspx. This activates that page in a hidden iFrame on the original page and downloads an Excel spreadsheet using this VB code:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        With Response
            .ClearContent()
            Dim filename As String
            filename = PreviousPage.SharedExportName
            .AddHeader("content-disposition", "attachment; filename=" & filename & ".xls")
            .ContentType = "application/ms-excel"
            .Write(PreviousPage.SharedOutput())
            .End()
        End With
    End Sub

Everything is working fine, and the original user interface still displays unscathed. But now, clicking any control in the page causes a postback to GenerateFile.aspx. How can I reset the page so that it posts back to ViewLoads.aspx instead?

Some of my searching has suggested using the RegisterStartupScript of the ScriptManager control, but I have not been successful in making that happen.
ASKER CERTIFIED SOLUTION
Avatar of rawinnlnx9
rawinnlnx9
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Amandeep Singh Bhullar
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.