Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have two different versions of javascript being rendered for validation summary removal for two different environments. Code for both the environments is the same.

Environment 1:
<script type="text/javascript">
document.getElementById('ValidationSummary1').dispose = function() {     Array.remove(Page_ValidationSummaries, document.getElementById('ValidationSummary1')); }
</script>


Environment 2:
<script type="text/javascript">
(function(id) {     var e = document.getElementById(id);     if (e) {         e.dispose = function() {             Array.remove(Page_ValidationSummaries, document.getElementById(id));         }         e = null;     } })('ValidationSummary1');
</script>


Can you please help me identify why is this happening. Also there are other issues happening with environment 1 code which I suspect is because of the different JS being rendered. Environment 2 is free of issues.

Rgds
Raveesh
Posted
Updated 25-Sep-14 1:27am
v2

1 solution

Your two systems are running different versions of ASP.NET. The first code block is generated by v2.0 / v3.5, whereas the second code block is generated by v4.5.

(I don't have a copy of the v4.0 assembly to check whether the change happened between v3.5 and v4.0 or between v4.0 and v4.5.)
 
Share this answer
 
Comments
Member 11108141 26-Sep-14 6:40am    
Thanks for the response.

I tried executing aspnet_regiis -i from v4.0 folder in Microsoft.NET/Framework folder for environment with first code block and I still get the same script for validation summary.

For your information, I am using F12 with IE9 to get the list of scripts being downloaded.

Just to give you more insight to my problem, I have a gridview with a child gridview that has more than 100 rows. When I try to add a new row at the client side for my child grid I get a SystemArgumentNull javascript error for the environment running the script from the first block. The environment with the second script block runs just fine and adds the new row.
I am using AjaxControlToolkit.dll.

Rgds,
Raveesh
Richard Deeming 26-Sep-14 7:04am    
Have you checked the .NET Framework version for the AppPool?

If that's set to 4.0, then it's possible that the code was changed between 4.0 and 4.5, in which case you'll need to install 4.5 on the server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900