What must I do to redirect to a Web Form from an MVC controller?
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>
No comments:
Post a Comment