Arif Sam Arif Sam - 1 year ago 108
ASP.NET (C#) Question

How to open MVC5 view from aspx page

Ive got an aspx file on the root of web application MVC5 project. I can go from Mvc View to the aspx file but im stuck on going back to mvc view. How do i go back from button event in Aspx? Fyi, this is just an empty project as im trying to learn on MVC. So everything is left as it is. Default configuration. The only difference that ive made is add redirect to the aspx page inside Home controller ActionResult.

Folder Structure and redirect code.

Folder structure and redirect code

p/s. If you are wondering why i used an aspx file inside my mvc, im trying to do dynamic rdlc reporting using reportviewer. Im not sure if it could be done using mvc view. As far as i know, razor engine could not use reportviewer and thats why i use an aspx file. Im probably wrong on this as im still very new in doing MVC. Tqvm in advanced.

Answer Source

Try this:-

First change your current code

public RedirectResult Report()
    return Redirect("~/ReportWebForm.aspx");

And in your .aspx page, add

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download