The problem with your code is you are referring like form.controlname
. In ASP.Net the control names are generated like ctl$imgLoading etc based on Master page/nested control configuration.
Better avoid
document.Form1.imgLoading
and make use of referring it based on id using nativedocument.getElementById()
If you have the script code in .aspx
page, Please use the below code to refer the element
var imgLoading=document.getElementById('<%= imgLoading.ClientID %>');
imgLoading.style.width=370;
In case if you have the script in JS file
Make sure you set the ClientIDMode=static
Supported from ASP.Net 4.0 only for imgLoading control in .aspx page, then
var imgLoading=document.getElementById('imgLoading');
imgLoading.style.width=370;