Anjala Baby
asked on
Window.Open() is showing a blank page
Hi,
I have to open a new window from one of my index page. So I have added Window.Open('../Home/Index .csHtml'). The new window is populating with a blank screen.
Regards,
Anjala
I have to open a new window from one of my index page. So I have added Window.Open('../Home/Index
Regards,
Anjala
ASKER
I need to open the window in a locally hosted application.
Then you can use the localhost in place of domain like this or whatever is your hostname:post if any http://localhost/Home/Index.csHtml
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're getting a blank page and if you look at the console you should have an error HTTP 404, page not found.
This is because csHTML files are not HTML files, they are MVC views that are processed by the MVC engine.
So what you need to use is the route that points to that view.
From the path you shared, big chances are that it's the root route, meaning just /
For instance:
This is because csHTML files are not HTML files, they are MVC views that are processed by the MVC engine.
So what you need to use is the route that points to that view.
From the path you shared, big chances are that it's the root route, meaning just /
For instance:
window.open('/');
This will fail if you're running your site in a virtual directory, so take tat in consideration.
ASKER
Yes. I am getting a blank page when giving Index.cshtml but there is no 404 error.
Also if I give Index instead of Index.cshtml, new window opened showing Access denied. Did I done anything wrong?
Also if I give Index instead of Index.cshtml, new window opened showing Access denied. Did I done anything wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Guys..It worked. I have given permission to my view.
ASKER
While giving Index policy to view, it worked.
So in your case window.open('http://www.sitename.com/' + 'Home/Index.csHtml');