Asp.net MVC How To Open New Window From Controller

11,783

Nothing can be done on server side but you can decorate your action links like

<%= Html.ActionLink("Pop Up", "PopUp", null, new {target="_blank"}) %>
Share:
11,783
user1011144
Author by

user1011144

Updated on July 11, 2022

Comments

  • user1011144
    user1011144 almost 2 years

    So I have a scenario where I want to return my ActionResult...Return View("ViewName", "MasterPageName",model); in a popup window of a specific size I can pass...

    E.G.:

    public ActionResult PopUp()
    {
      //do some work...
    
      //I want this returned in a popup window/modal dialog of some sort...
      return View("ViewName","MasterPageName",model); 
    }
    

    what is a reasonable way to accomplish this from the controller in asp.net mvc?

    thanks in advance.