JavaScript Function Error on .aspx page C#

Asked By 20 points N/A Posted on -

I need help in modifying a javascript for .aspx page. I do get a javascript error on my file upload javascript function.  It is using document.getElementById() and then the element is passed. I don’t know what caused this error but loading of the page with the javascript and gets an error. Please see the error below for further details.

Server Error in '/' Application.

The controls collection cannot be modified because the control contains code blocks (i.e. <% … %>).

Answered By 0 points N/A #113809

JavaScript Function Error on .aspx page C#


Hello Mayer,

Can you share the actual code behind this page, as it will help to identify that where the problem lies.

As per the given error message, there can be a problem of using tags for writing Javascript in pages.

Check if the script is starting with

<script language="Javascript">

Add your javascript code here in between the these 2 tags.


And do specify which coding language are you using for the page. i.e. VB or C#


Login/Register to Answer

Related Questions