Alligator tags(<% %>) inside js string?
- by bangoker
I am trying to redirect a page reading the url from the config file.
However, when I try this:
<script type="text/javascript">
<%string redirectUrl = System.Web.Configuration.WebConfigurationManager.AppSettings["RedirectURL"];%>
window.parent.location.replace("<%=redirectUrl%>");
</script>
the alligator tags <% % are Not being highlighted, and when I run I get the following error in the yellow screen:
the controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
What am I doing wrong??
Thanks!