MVC 3 Razor PopUp Window

Posted by Vipul on Stack Overflow See other posts from Stack Overflow or by Vipul
Published on 2011-08-02T11:13:56Z Indexed on 2012/11/01 5:01 UTC
Read the original article Hit count: 144

I need to open a new pop up window on click of a button in a view. The new window should be redirect to a specific actionmethod in a specific controller. I also need to provide attributes for size of the new pop up window. I have been trying the following code:

<input type="button" name = "ClickMe" Value="ClickMe" onclick= "javascript:window.open('/Home/Create/','Customer Search',height='window.screen.height - 100', width='200',left='window.screen.width - 250' ,top='10',status='no',toobar='no',resizable='yes',scrollbars='yes')"/>

On click of button, nothing happens. I get following Javascript error:

Line: 19
Char: 1
Error: Invalid argument.
Code: 0

When I check the ViewSource of the HTML rendered, I find the line to be the one which is rendering the button. I am using Windows Vista with IE 7. I am working on MVC 3 with Razor Engine in VS 2010

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about asp.net-mvc-3