21 Answers, 1 is accepted
I cannot reproduce this problem in our online demos. I have tested with FireFox 3.0.3 and FireBug 1.121.
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
This seems to be a known bug in MS Ajax. Please try the workaround submitted here.
Best wishes,
Veselin Vasilev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
http://www.telerik.com/help/aspnet-ajax/ajxerrorhandling.html
We are having the problem as well. I put the following in the Page_Load method of the master page and still get the same error (also tried actual page's Page_Load with same result).
ClientScriptManager cs = Page.ClientScript;
if (!cs.IsStartupScriptRegistered(this.GetType(), "AjaxBugFix"))
{
string str = "Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) { ";
str +=
"if (!this._upperAbbrMonths) { ";
str +=
"this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); } ";
str +=
"return Array.indexOf(this._upperAbbrMonths, this._toUpper(value)); };";
cs.RegisterStartupScript(
this.GetType(), "AjaxBugFix", str, true);
}
If you use RadTreeView for ASP.NET Ajax you need to use the RegisterStartupScript static method of the ScriptManager class.
Regards,
Veselin Vasilev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
string str = "Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) { ";
str +=
"if (!this._upperAbbrMonths) { ";
str +=
"this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); } ";
str +=
"return Array.indexOf(this._upperAbbrMonths, this._toUpper(value)); };";
ScriptManager.RegisterStartupScript(this, this.GetType(), "AjaxBugFix", str, true);
I am out of ideas why it is not working. Can you please open a support ticket and attach there a sample running project demonstrating the issue.
Thanks
Greetings,
Veselin Vasilev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Firefox v3.0.7
Firebug v1.3.3
Dim Str = "Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) { "
Str +=
"if (!this._upperAbbrMonths) { "
Str +=
"this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); } "
Str +=
"return Array.indexOf(this._upperAbbrMonths, this._toUpper(value)); };"
ScriptManager.RegisterStartupScript(
Me, Me.GetType(), "AjaxBugFix", Str, True)
f (Sys.CultureInfo.prototype._getAbbrMonthIndex) {
try {
Sys.CultureInfo.prototype._getAbbrMonthIndex('');
del('');
} catch (ex) {
.....
Replace the try block by
try {
var del = Function.createDelegate(Sys.CultureInfo.CurrentCulture != null ? Sys.CultureInfo.CurrentCulture : Sys.CultureInfo.InvariantCulture, Sys.CultureInfo.prototype._getAbbrMonthIndex);
del('');
} catch (ex) {
......
keeping the catch block and everything else the same. This should fix this error up. Leave me a message on www.matrixconnects.com if you need to understand the fix!
PS: Yeah I am promoting my site, I am shameless!
I'm having the same problem here in a RadWindow.
In this window I dynamically fill a table with multiple columns / rows and some of the cells with a LinkButton.
During this process, I get the following error detected in firebug:
I understand that the bug is in the MS AJAX framework, but how can I fix it?
Where can I find and edit AjaxControlToolkit.Common.Common.js file?
Thanks for your help!
Ricardo.
I don't think your problem is related to MS AJAX datetime literal issue. Can you post more details?
Thanks Nik!
My code structure is the following
Aspx1 - grid; on row button click, opens RadWindow
Aspx2 - inside RadWindow, includes an ascx1 with all the dynamic generation logic
Aspx3 - My main goal is to open another RadWindow with aspx3, when I click in each one of the LinkButtons I dynamically generate in ascx1 (inside aspx2).
The generation is done with the following code:
TC = New HtmlTableCell img = New LinkButton |
img.ID = "M" & dtInicio.Year.ToString & dtInicio.Month.ToString & i & j |
img.Text = SelectedAcronyms(j) |
img.Width = Unit.Pixel(16) |
img.ToolTip = SelectedTooltip(j) |
If SelectedReturnID.Count > 0 Then |
img.CommandArgument = SelectedReturnID(j) |
AddHandler img.Click, AddressOf getV_Click |
Else |
img.Enabled = False |
End If |
TC.Controls.Add(img) |
When I click on one of the LinkButtons, I run this code:
Dim script As String = "" |
script = [String].Format("return ShowSessionEditForm('{0}');", e.ReturnID) |
Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", script, True) |
But after this, I get another javascript error in Firebug
So it seems that the getAbbrMonthIndex error is somehow related to this problem here.
I tried two techniques concerning the javascript function ShowSessionEditForm (both of them working in other pages of my web app):
function ShowSessionEditForm(idSession) { |
window.radopen("SessionManagementEdit.aspx?session=" + idSession, "SessionEditDialog"); |
return false; |
} |
function ShowSessionEditForm(idSession) { |
var parentPage = GetRadWindow().BrowserWindow; |
var parentRadWindowManager = parentPage.GetRadWindowManager(); |
var oWnd2 = parentRadWindowManager.open("SessionManagementEdit.aspx?session=" + idSession, "SessionEditDialog"); |
window.setTimeout(function() { |
oWnd2.setActive(true); |
}, 0); |
} |
Any thoughts on this?
Thanks again,
Ricardo.
Ps: meanwhile, some of the (many, many) info Firebug shows pointed me to the grid in Aspx1. Four of the columns had this attribute DataFormatString={0:d}. I removed this instruction in each of the grid columns and the first getAbbrMonthIndex error I talked about, which occurred during the aspx2 loading, disapeared! And even after adding again the DataFormatString, it never showed up again. Strange!
Dim script As String = "" |
script = [String].Format("return ShowSessionEditForm('{0}');", e.ReturnID) |
Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", script, True) |
By
Dim script As String = "" |
script = [String].Format("ShowSessionEditForm('{0}');", e.ReturnID) |
Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", script, True) |
your original markup will render on the page as
<script type="text/javascript">
return ShowSessionEditForm(22834882);
</script>
Which is incorrect since there is no function from which you are returning.
Hope this helps.
I tried your solution, and it worked :D
Removing "return" in the code-behind and using this version of the javascript function:
function ShowSessionEditForm(idSession) { |
var parentPage = GetRadWindow().BrowserWindow; |
var parentRadWindowManager = parentPage.GetRadWindowManager(); |
var oWnd2 = parentRadWindowManager.open("SessionManagementEdit.aspx?session=" + idSession, "SessionEditDialog"); |
window.setTimeout(function() { |
oWnd2.setActive(true); |
}, 0); |
} |
Thank you very much, Nik!
Best regards,
Ricardo.
Ps: Using the other version of the javascript function, I got the following error in firebug:
If you need anymore help with anything in general either leave a comment in this thread or catch me on www.matrixconnects.com or www.britishpcrepairs.co.uk
I changed the code as suggested and added updated dll in project solution which pasted below, but it didn't work.
if (Sys.CultureInfo.prototype._getAbbrMonthIndex) {
try {
var del = Function.createDelegate(Sys.CultureInfo.CurrentCulture != null ? Sys.CultureInfo.CurrentCulture : Sys.CultureInfo.InvariantCulture, Sys.CultureInfo.prototype._getAbbrMonthIndex);
del('');
} catch (ex) {
Sys.CultureInfo.prototype._getAbbrMonthIndex = function(b) {
var a = this;
if (!a._upperAbbrMonths) a._upperAbbrMonths = a._toUpperArray(a.dateTimeFormat.AbbreviatedMonthNames);
return Array.indexOf(a._upperAbbrMonths, a._toUpper(b))
};
Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;
Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;
}
};
Is there anything more that needs to be done ?
- Kapil
Suffice you to change the function like this:
function Sys$CultureInfo$_getAbbrMonthIndex(value) {
if (!this._upperAbbrMonths) {
if(!this.dateTimeFormat)
{
return value;
}
this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
}
return Array.indexOf(this._upperMonths, this._toUpper(value));
}
Anyway, the problem occurs when i use Calendarextender.