MistyD
MistyD

Reputation: 17233

Loading a pop up page in ASP.net through a js file

I currently have a js file that gets loaded with a page. Now that .js file has the following statement in it

$("#Click").on('click', function () {
    __CHILD_WINDOW_HANDLE = window.open('MyPopUp.html', '_blank', 'width=700,height=500,left=200,top=100');
});

From the above statement when the user clicks on the "Click" button a child window (MyPopUp.html) should load up , however I get the error

 The resource cannot be found.

My question is how do I specify the path of the html file ? The only way I am familiar with is through RouteConfig.cs in which Ill need to introduce another controller. Any suggestions on how I can accomplish this ?

Upvotes: 1

Views: 43

Answers (1)

MistyD
MistyD

Reputation: 17233

I solved this issue by creating a separate controller and then having that controller return the html file. Also since I am using razor html files are not allowed so I had to return back a cshtml file.

Upvotes: 1

Related Questions