Monday 30 June 2014

How to redirect one page to other in Asp.Net MVC 4?



window.location.href example: window.location is object that holds all information about current document location (host, href, port, protocol etc.). location.href is shorthand for window.location.href.They acting the same when you assign url to them - this will redirect to page which you assing, but you can see difference between them, when you open console (firebug, of developer tools) and write window.location and location.href

window.location.href = '@Url.Content("~/HTML/BrowserNotSupported.html")'; //Will take you to BrowserNotSupported.html.

window.open() example:

window.open('http://www.yahoo.com'); //This will open yahooin a new window.

No comments:

Post a Comment