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.SharedExportN ame
.AddHeader("content-dispos ition", "attachment; filename=" & filename & ".xls")
.ContentType = "application/ms-excel"
.Write(PreviousPage.Shared Output())
.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.
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.SharedExportN
.AddHeader("content-dispos
.ContentType = "application/ms-excel"
.Write(PreviousPage.Shared
.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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.