我对.net的经验有限.我的应用程序抛出一个错误this.dateTimeFormat是未定义的,我追溯到一个已知的ajax错误.发布的解决方法说:
Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) { if (!this._upperAbbrMonths) { this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); } return Array.indexOf(this._upperAbbrMonths,this._toUpper(value)); };
你会用
ClientScriptManager.RegisterStartupScript()
原文链接:https://www.f2er.com/ajax/159938.htmlstring str = @"Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) { if (!this._upperAbbrMonths) { this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); } return Array.indexOf(this._upperAbbrMonths,this._toUpper(value)); };"; if(!ClientScriptManager.IsStartupScriptRegistered("MyScript"){ ClientScriptManager.RegisterStartupScript(this.GetType(),"MyScript",str,true) }