I am using Asp.net c# with javascript
I want use the Session value in javascript so am using this code:
<script type="text/javascript">
var Warehousename = '<%= Session["warehouse_id"] %>';
var temp = new Array();
temp = Warehousename.split(",");
if (temp.length > 1) {
alert('you have multiple access of warehouse. Kindly select the only one warehouse from Preference')
window.location.href = "frm_preferences.aspx";
}
</script>
But am facing some error like
'The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).'
So where am doing wrong please suggest me