How can I use inline ASP.NET tags inside JavaScript?

Posted by Bob on Stack Overflow See other posts from Stack Overflow or by Bob
Published on 2010-03-28T22:05:53Z Indexed on 2010/03/28 22:13 UTC
Read the original article Hit count: 164

Filed under:

How can I use ASP.NET inline tags from within a block of JavaScript? For example:

<script type="text/javascript">
     // Do some AJAX here, then redirect to a new page on the next line.
     window.location = "/Movie/" + <%= html.encode(MovieName) %>;
</script>

© Stack Overflow or respective owner

Related posts about asp.net-mvc