views:

30

answers:

2

Hello

I was wondering how you best open a new window and show a view there using mvc?

and is there a way to using jquery or similar, to print an area of a document? lets say everything within a div?

/M

+1  A: 
<%= Html.ActionLink("action", "controller", new { target = "_blank" }) %>
Darin Dimitrov
+1  A: 

Opening a new window is easy, you would do it like you would any other way, passing a URL to the content you want to open in the new window whether it be through a link, or a call through Javascript.

The only way that ASP.NET MVC helps here is in the utility functions that can give you the URL of a route or an action which you would then write directly into your view.

As for printing part of a page, a simple Google search on "jQuery print" (not as a phase) turned this up as the second result:

Ask Ben: Print Part Of A Web Page With jQuery

casperOne