AMDI
AMDI

Reputation: 973

open a new window form action method in MVC

I am trying to open a url from the javascript function.

The issue is I am not able to authorize it the url mentioned in the image.

How can I load the page from the action method so that i can authorize the url.

Here is my Javascript method.

<img src="~/Images/question_frame.png" style="margin-top:3px;height:18px;width:20px;" onclick="window.open('../help/nmc/enu/default.htm', 'NMCHelp', 'toolbar=no, scrollbars=yes, resizable=yes, top=50, left=50, width=750, height=600');"/>

How can i achieve this?

How do i get the window.open(.../help/nmc/enu/default.htm) to opened from the action method in a new window so that when anyone tried to open the window with out authorized will be redirected to login page.

Upvotes: 0

Views: 578

Answers (1)

CodeCaster
CodeCaster

Reputation: 151586

You're displaying a static HTML file, which will bypass MVC entirely.

The easiest would be to create an authorized action method and link to that instead. Then in the action method, return the contents of the HTML file. See Render HTML file in ASP.NET MVC view?.

Upvotes: 2

Related Questions