Trying to put together a quick and dirty page to redirect to another website in a new window.
So I stash a url in the session, redirect to the page from mvcSiteMap, hit the page…
run this javascript
$(document).ready(function () {
window.open( '@HttpContext.Current.Session["EisUrl"].ToString();' );
});
</script>
}
and instead of opening a new window pointing to google.com, I get the same window with this message.
The view ‘http://google.com’ or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/ReportsManagement/http://google.com.aspx
~/Views/ReportsManagement/http://google.com.ascx
~/Views/Shared/http://google.com.aspx
~/Views/Shared/http://google.com.ascx
~/Views/ReportsManagement/http://google.com.cshtml
~/Views/ReportsManagement/http://google.com.vbhtml
~/Views/Shared/http://google.com.cshtml
~/Views/Shared/http://google.com.vbhtml
So it’s treating my external URL as if it’s still internal to the website…
This seems like it ought to be pretty simple….. clearly I’m missing something obvious.
Any Help is appreciated.
I figured it out, i was being an id 10 t,
I had this in the view(razor)
and this in the controller
So it’ was trying to pass the string as a model, I decided i was unsure of the exact behavior and swapped to putting it in the session.. but left those in place.
For some reason, the string was getting interpteted as a URL, the fact that the new window was not openeing should have been a clue it was going off the rails early.
When I removed the line from the model and the url paramter from the return View()… it now redirects correctly (just not in a new page but I’ll get that)
Thanks for all the help!