id advises not to force the static and bounding region of C # ASP with its own controls, ID rather advises escaping special characters like this
document.getElementById('/</%= uploadResult.ClientID /%/>').innertext = "xyz or whatever";
if necessary, put it in a loop and iterate over each elementsArr function and change it to
document.getElementById('/</%= '+ elementsArr[x] +'.ClientID /%/>').innertext = "xyz or whatever";
but the best solution would be to use sizzle search (jquery) for all elements that have an id starting with ctl00, asp elements always have ctl00 added by default.
$("id^=ctl00").each(){
// use this function by calling the identifier of the variable, then divide by underscores (_)
// push the last value into the array ... , i.e. the last element after all underscores are always the real identifier. and using hiss in this way, you only work with asp elements thanks to the amazing selector, which is smaller than the lol code, to do more. });
I really apologize for the shorthand, but its latency, I did it before and its most stable version, which I know, you can not cause any conflicts by changing the standard specification. (ALWAYS LEGAL PRACTICE SHOULD BE SO)
source share