This is a migrated thread and some comments may be shown as answers.

MicrosoftAjax.js - error on grid update/delete

11 Answers 308 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ryan
Top achievements
Rank 1
Ryan asked on 12 Jul 2011, 05:25 AM
I have a grid which displays a list of logins. I use a SQL View in Entity Framework to render these logins, called vew_AccountLogin (since we can't use the "real" database objects since they have circular foreign keys).

One of the fields in vew_AccountLogin is "mod_date" which, in our CMS, is the date that the login record was last modified (e.g. by customer service personnel or the account administrator). Before upgrading to 2011.1.315, we had no problems.

Now, when I go to delete or update someone, my controller is never called, because I get a javascript error in MicrosoftAjax.debug.js:
Uncaught Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.

In this function, format = "undefined" and I don't think it's supposed to be:
Date.prototype.format = function Date$format(format) {
/// <summary locid="M:J#Date.format" />
/// <param name="format" type="String"></param>
/// <returns type="String"></returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
MicrosoftAjax.debug.js:2599Uncaught Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.
MicrosoftAjax.debug.js:2599Uncaught Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.
return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture);
} Prev stack trace local vars:
  1. a"EntityKey[EntityKeyValues][13][Value][format]"
  2. bfunction Date$format(format) {
    1. argumentsArguments[0]
    2. callerfunction (a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)}
    3. length1
    4. name"Date$format"
    5. prototypeDate$format
    6. __proto__function Empty() {}

Previous again:
  1. a"EntityKey[EntityKeyValues][13][Value]"
  2. bMon Jul 11 2011 22:43:01 GMT-0500 (Central Daylight Time)
    1. __proto__Date
  3. cundefined
  4. efunction (a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)}
  5. f"format"
  6. thisDOMWindow


"format" is "undefined" - it shouldn't be. It never used to be. "b" above does not look correct. It should be in standard format, NOT javascript date format. Why was this changed? It is wreaking havoc all over my project. We hold a developer's license (Blue Earth Interactive) and I am not pleased in the least that this is occurring. Aren't you regression-testing before making new releases?

I am not able to send a sample project on here directly for this due to confidentiality, but I'll be happy to provide any information needed as this is easily reproducible, or I can e-mail the project directly, though you will not have any database access and I can't be responsible for creating a sandbox as I do not have the time.

Seems somewhat similar to:
http://www.telerik.com/community/forums/aspnet-mvc/grid/mvc-grid-ajax-update-delete-causes-datetimeformat-is-null-or-not-an-object.aspx
But the hotfix did not change anything - still get the same error.

Also, if I use MicrosoftAjax.js (not the .debug.js version), I receive:
Uncaught TypeError: Object [object DOMWindow] has no method '_toFormattedString'

This project is using MVC 2. Help!

11 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 12 Jul 2011, 05:48 AM
Also, this happens with any <T> I'm using on a grid that contains a DateTime object. Even if it's a class with one property that's a DateTime. MicrosoftAjax.js seems to be expecting a DateTime format, while Telerik seems to provide a JavaScript Date format. This never occurred before upgrading.

e.g. if I have this model:
public class TestModel
{
    public DateTime MyProperty {get; set;}
}

And I make a grid:
Html.Telerik.Grid<TestModel> ....

I get the same errors when it tries an AJAX POST (Delete or Update).

Finally, here is the data object being AJAX'ed. #b[13] (in bold) is the offending parameter that can't be formatted in 2011.1.315. I could technically set [XmlIgnore, ScriptIgnore] on this as a work-around, but that obviously wouldn't be acceptable in other areas of the site where we need mod_date.

  1. a"EntityKey[EntityKeyValues]"
  2. bArray[15]
    1. 0Object
      1. Key"login_id"
      2. Value92646
      3. __proto__Object
    2. 1Object
      1. Key"username"
      2. Value"ryantest711"
      3. __proto__Object
    3. 2Object
      1. Key"password"
      2. Value"6f1ed002ab5595859014ebf0951522d9"
      3. __proto__Object
    4. 3Object
      1. Key"email"
      2. Value"1@2.3"
      3. __proto__Object
    5. 4Object
      1. Key"email_optout"
      2. Value"N"
      3. __proto__Object
    6. 5Object
      1. Key"password_is_temp"
      2. Value"N"
      3. __proto__Object
    7. 6Object
      1. Key"account_admin"
      2. Value"N"
      3. __proto__Object
    8. 7Object
      1. Key"allow_self_edit"
      2. Value"Y"
      3. __proto__Object
    9. 8Object
      1. Key"active"
      2. Value"Y"
      3. __proto__Object
    10. 9Object
      1. Key"restricted_user"
      2. Value"N"
      3. __proto__Object
    11. 10Object
      1. Key"deleted"
      2. Value"N"
      3. __proto__Object
    12. 11Object
      1. Key"mod_user_id"
      2. Value0
      3. __proto__Object
    13. 12Object
      1. Key"mod_login_id"
      2. Value92646
      3. __proto__Object
    14. 13Object
      1. Key"mod_date"
      2. ValueMon Jul 11 2011 22:43:01 GMT-0500 (Central Daylight Time)
      3. __proto__Object
    15. 14Object
      1. Key"isOwner"
      2. Value0
      3. __proto__Object
    16. length15
    17. __proto__Array[0]
  3. cundefined
  4. efunction (a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)}
  5. fundefined
  6. thisDOMWindow
0
Ryan
Top achievements
Rank 1
answered on 14 Jul 2011, 09:15 AM
Please? Somebody respond? This project is due this week and this is preventing delivery.
0
Atanas Korchev
Telerik team
answered on 14 Jul 2011, 09:21 AM
Hi Ryan,

 This is not a known issue and we are not sure what may be causing it. I suggest you attach a runnable project to this forum thread so we can check what went wrong.

 By the way all our editing demos are using a DateTime property without this problem.

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ryan
Top achievements
Rank 1
answered on 14 Jul 2011, 09:24 AM
Thanks for the response. As per my original message, I cannot attach the project publicly as it is copyright material. If you can provide an address I can send to, that would work - but you will not have access to the SQL server so you'll need to "dummy" a TON of data, as the database contains live personal and financial information covered under data privacy acts.

If the need arises, I can possibly provide VPN and read-only DB access to certain tables.

This did not occur prior to the upgrade to 2011.1.315, so it's definitely somehow related. It could be MicrosoftAjax.js being incompatible, an incompatible version of jQuery, or a Telerik incompatibility.
0
Ryan
Top achievements
Rank 1
answered on 14 Jul 2011, 09:27 AM
Also, are your online demos actually serializing to and from Entity Framework objects? Further, they are running MVC 3, correct? We are not - we use MVC 2.
0
Atanas Korchev
Telerik team
answered on 14 Jul 2011, 09:32 AM
Hi Ryan,

 I am afraid we cannot help you unless we somehow reproduce the problem. Providing a sample project is the only possible way to do so.

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ryan
Top achievements
Rank 1
answered on 14 Jul 2011, 09:36 AM
Ok, I don't like repeating myself. Please read this carefully and understand, as it will be the 3rd time I say it: I MUST SEND THE PROJECT TO AN EMAIL ADDRESS (yours) - it CANNOT be posted PUBLICLY. Also, my company, Blue Earth Interactive, holds a DEVELOPER LICENSE. I am NOT impressed so far with the poor level of support we are being given.
0
Ryan
Top achievements
Rank 1
answered on 14 Jul 2011, 09:38 AM
Also, as I wrote earlier, it seems to be VERY similar to the problem this person had:
http://www.telerik.com/community/forums/aspnet-mvc/grid/mvc-grid-ajax-update-delete-causes-datetimeformat-is-null-or-not-an-object.aspx

0
Atanas Korchev
Telerik team
answered on 14 Jul 2011, 09:41 AM
Hello Ryan,

I cannot provide you with an email address. You can open a support ticket though. We can exchange private information there. To do so you should ask the owner of the commercial license to add you as a licensed developer from the Telerik web site.

On a side note you mentioned you are using 2011.1.315 which is not the latest official version of the Q1 2011 release. You can try upgrading to 2011.1 414 to see if the problem is resolved. The commercial license gives you access to service packs and internal hotfix builds. Once you are added as a licensed developer you would get access to those bits as well.

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ryan
Top achievements
Rank 1
answered on 16 Jul 2011, 02:21 AM
Whatever it was, it has been fixed as of 2011.2.712. I am no longer receiving the errors anywhere that I can tell, so it was definitely something wrong in your 2011.1.315 build.

Thanks!
0
Edward
Top achievements
Rank 1
answered on 03 Aug 2011, 12:11 PM
I'm getting this issue in 2011.2.712.340

The error is indeed getting thrown in the MicrosoftAjax.cs.

Its happening when pressing update after doing a batch edit. If I put a breakpoint in the controller action that handles the batch editing, it doesn't get hit.

I'll try and create a solution where this error occurs and will attach it. It's a fairly simple client grid.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Atanas Korchev
Telerik team
Edward
Top achievements
Rank 1
Share this question
or