Return from Response.Redirect fires all events
I have a page with a Search button, Clear button and a grid (ComponentArt). Once the user searches a record, he can print through the grid a report in pdf format. The grid has a link button embedded. The report pops out in a new screen using URL access. The code is below. Once the user closes the report, and clicks on the Search or Clear buttons of the original screen, the Grid event fires yet again (without clicking on the grid). How can I avoid this. Thanks. public static string RetrieveReportUrlRegisterDeposit(int depositId) { string reportUrl = ServerHeader + @"RegisterDeposit&rs:Command=Render&DepositId={0}&ShowGLSummary=True&rs:Format=PDF&rc:Parameters=true"; return string.Format(reportUrl, depositId); } protected void CAGrid_ItemCommand(object sender, ComponentArt.Web.UI.GridItemCommandEventArgs e) { if (e.Control is System.Web.UI.WebControls.LinkButton) { LinkButton linkButton = (LinkButton)e.Control; if (linkButton.CommandName == "PrintReport") { int depositId = (int)e.Item["DepositId"]; Response.Redirect(ReportManager.RetrieveReportUrlRegisterDeposit(depositId)); } } }
January 29th, 2011 4:52pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics