Asp.net MVC How To Open New Window From Controller

user1011144 picture user1011144 · Oct 24, 2011 · Viewed 11.8k times · Source

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.

Answer

Emmanuel N picture Emmanuel N · Oct 24, 2011

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

<%= Html.ActionLink("Pop Up", "PopUp", null, new {target="_blank"}) %>