Like the ASP.Net part, but you want it inside quotes, for example:
window.location = "/Movie/<%= html.encode(MovieName) %>";
Since it is displayed on the page, it will look like this:
window.location = "/Movie/MyMovie";
Outside of quotes, it will look like this:
window.location = "/Movie/" + MyMovie; //thinks MyMovie is a variable, not true!
source share