简体   繁体   中英

Overriden Asp.net validator's javascript function is lost on partial postback

I have web application in asp.net 4.5 framework in asp.net.

I have overridden javascript function of asp.net validator "ValidatorUpdateDisplay". It has been overridden in order to achieve custom functionality of showing red border around the control instead of showing validator asterisk.

Now the problem is that on production server, when partial postback occurs via button click of control placed inside update panel. The overriden function is not called, instead .Net's in built javascript function "ValidatorUpdateDisplay" is called.

Also along with there, other javascript functions that is overriden by Telerik in there scriptresource.axd is also lost, after partial postback, instead of Telerik's function, .Net function is called.

Along with it the asp:menu control also stops working after postback, its sub menu is not opening.

This issue seem to happen only in production environment. Everthing is working fine in local as well as staging environment.

Just to add, I have used asp:scriptmanger on my page.

// this method overrides the .net framework's 'ValidatorUpdateDisplay' method to
// add / remove class on validated control.
function ValidatorUpdateDisplay(val) {
  // Code to add class to validators control to validate control.
}

The issue was due to windows update that caused the problem, whereas the same was not installed in staging server. It contained framework update for version asp.net 4.6 and 4.6.1. Restarting the production machine fixed the issued.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM