I am dynamically generating a string in c# that I want to fill a <div> element within javascript. I'm having a few problems with the string parsing.
The 'somepage.aspx' is throwing an error within the javascript, says it is expecting ;.
The 'somepage.aspx' is throwing an error within the javascript, says it is expecting ;.
Code:
<div id="stuff">
</div>
<%
string strDiv = "<ul><li><a href='somepage.aspx'></a></li></ul>";
%>
<script type="text/javascript">
var str = '<%= strDiv %>';
document.getElementById('stuff') = str;
</script>