I have this line in my controller:
Response.Redirect("~/WebForms/ReportViewer.aspx");
Then this simple test code in Page_Load
of "ReportViewer.aspx":
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Hello");
return;
}
This code does not even execute, i.e. Page_Load
does not execute. I suppose there is something I'm supposed to do before redirecting to a web form, but have no idea what it is. I have seen ample sample code that just plainly calls Redirect
.
My web form does have a Crystal Reports viewer on it, which may have something to do with the situation:
<body>
<form id="form" runat="server">
<CR:CrystalReportViewer ID="CrystalViewer" runat="server" AutoDataBind="true" />
</form>
</body>
return Redirect("~/Webform.aspx");
is perfect and its return type is RedirectResult and it works awesome, I have tested it.
My Action look like this
public ActionResult Print()
{
return Redirect("~/Webform2.aspx");
}
Thanks to @Andrey Gubal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With