Script tag in ASPX page is written partially (output stopped at random)
- by Nir
I have an aspx page where I put a script tag with .net "if" and "else".
The problem is that the output gets cut at random points each time. Sometimes it's ok, sometimes I get cropped output.
The code itself (Simplified example):
<body id="body" runat="server">
<form id="form1" runat="server">some HTML
<script type="text/javascript">
window.addEvent('domready', function() {
var x = "nothing";
<% if(someCondition){%>
x = "2";
<%} else {%>
x = "3";
<%}%>
});
</script>
</form>
</body>
The cropped output:
<body id="body" runat="server">
<form id="form1" runat="server">some HTML
<script type="text/javascript">
window.addEvent('domready', function() {
var x = "nothi
</script>
</form>
</body>
Does anybody have a clue?