-
22 Sep 2009 10:14 AM #91
Possible Timeout problems
Possible Timeout problems
I have some requests that never return. I'm using the paging controller, on the server side the data is returned, but the clientside never finishes.
I suspect that it is a timeout issue, because the requests that don't work are randomly distributed, but all the requests that don't work are larger in size.
There is a way to add to the direct request timeout in 3.0.2 but I don't know where this is set. It has to be really low right now, because the requests that don't work are not very large at all, they are just bigger than the others.
-
25 Sep 2009 3:55 PM #92
I found out why
I found out why
I finally figured out why some request never return.
They were a bit huger than I expected because the server was returning all attachments that had been uploaded along with a page content.
I guess that is the downside of handing a complex object off to Direct() parser. Deeply nested inside one of the objects, one of these were too big.
-
6 Oct 2009 10:24 AM #93
** Important update. Please read. **
Ext.Direct for ASP.NET MVC v0.6.3 is uploaded.
In previous versions all dates were serialized using Json.NET's JavaScriptDateTimeConverter by default unless another converter is specified by a developer.
In this version a new dateFormat configuration attribute is introduced that allows you to specify what DateTime serialization format to use by default. Supported values are "Iso" and "JavaScript" to use Json.NET's IsoDateTimeConverter or JavaScriptDateTimeConverter respectively. If this attribute is not set in your application's config file, or contains value other than supported, then all dates will be serialized using the default Json.NET's serialization format which is the same as the one used by Microsoft. "\/Date(1198908717056)\/"
If you are upgrading from an older version you will most likely have to add the new dateFormat config attribute to your application's web.config file since the default serialization format of dates has changed in this version.
Please refer to the first post for the updated version of Ext.Direct.Mvc.Eugene
Ext.Direct for ASP.NET MVC
-
9 Oct 2009 12:10 AM #94
I can't download this file from the author's link,can some one send it to my email: kenkrizzard@gmail.com ?
I'll very appreciate you help.
-
11 Oct 2009 7:20 PM #95
Self referencing loop error
Self referencing loop error
I have a recreation of your test application working fine displaying records from your "Employees" table. I've created and tested my data context, so it should be working fine but I keep getting the following error...
Has anybody gotten this error before? I'm sure it's something small... I'm a little new to both ASP.net MVC and Ext.js...Code:Newtonsoft.Json.JsonSerializationException was unhandled by user code Message="Self referencing loop" Source="Newtonsoft.Json" StackTrace: at Newtonsoft.Json.Serialization.JsonSerializerWriter.CheckForCircularReference(Object value, Nullable`1 referenceLoopHandling) at Newtonsoft.Json.Serialization.JsonSerializerWriter.WriteMemberInfoProperty(JsonWriter writer, Object value, JsonProperty property) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeList(JsonWriter writer, IList values, JsonArrayContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter) at Newtonsoft.Json.Serialization.JsonSerializerWriter.WriteMemberInfoProperty(JsonWriter writer, Object value, JsonProperty property) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter) at Newtonsoft.Json.Serialization.JsonSerializerWriter.WriteMemberInfoProperty(JsonWriter writer, Object value, JsonProperty property) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeList(JsonWriter writer, IList values, JsonArrayContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeEnumerable(JsonWriter writer, IEnumerable values, JsonArrayContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter) at Newtonsoft.Json.Serialization.JsonSerializerWriter.WriteMemberInfoProperty(JsonWriter writer, Object value, JsonProperty property) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter) at Newtonsoft.Json.Serialization.JsonSerializerWriter.WriteMemberInfoProperty(JsonWriter writer, Object value, JsonProperty property) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract) at Newtonsoft.Json.Serialization.JsonSerializerWriter.SerializeValue(JsonWriter writer, Object value, JsonConverter memberConverter) at Newtonsoft.Json.Serialization.JsonSerializerWriter.Serialize(JsonWriter jsonWriter, Object value) at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value) at Newtonsoft.Json.JsonSerializer.Serialize(JsonWriter jsonWriter, Object value) at Newtonsoft.Json.JsonSerializer.Serialize(TextWriter textWriter, Object value) at Ext.Direct.Mvc.DirectResult.ExecuteResult(ControllerContext context) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\iNote\Ext.Direct.Mvc\Ext.Direct.Mvc\DirectResult.cs:line 71 at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass11.<InvokeActionResultWithFilters>b__e() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) InnerException:
Anyways, thanks ahead of time for any help you can give me.
-
12 Oct 2009 5:43 AM #96
The JSON serializer has no concept of what it can and cannot serialize (unless specified). It looks like you may have some lazy loading objects that is causing this (child -> parent, parent -> children, etc). My suggestion is to flatten out your objects to DTO's instead of sending a raw business object. Look at something like AutoMapper to make your life easy for this.
-
12 Oct 2009 3:12 PM #97
Excluding my relationships may fix the problem, how would I go about doing this?
Excluding my relationships may fix the problem, how would I go about doing this?
My model designer includes a bunch of extra code in my data context that would include relationship values to another table. Is there a way to exclude my one-to-many relationship (using LinqToSql) from my IQueryable object before I hand it over to result["data"]?
Here's my controller code:
Code:SchcommDataContext _db = new SchcommDataContext(); public ActionResult Get(int start, int limit, string sort, string dir) { var schcommList = _db.Schcomms .OrderBy(sort + " " + dir) .Skip(start) .Take(limit); var result = new { total = _db.Schcomms.Count(), data = schcommList // This value must contain information about my model associations that doesn't serialize properly }; return Direct(result); }
-
13 Oct 2009 11:17 AM #98
Ext.Direct for ASP.NET MVC v0.6.4 is uploaded. Please see the first post for download link.
Latest changes:
* Added: small adjustment for integration with the Ext Designer
If you're currently using v0.6.3 you don't have to upgrade.Eugene
Ext.Direct for ASP.NET MVC
-
14 Oct 2009 5:22 AM #99
Hi
I want to be able to send down method names as properties on objects - i basically want to send an object which is the colmodel. each of the colmodel items has a renderer method in it:
i omit the quotes to send it as an object using a JsonConverter:Code:{header: 'Name', dataIndex: 'Name', sortable: true, renderer: renderers.defaultRenderer }
which gets added to the c# property like:Code:public class JavascriptMethodConverter : JsonConverter { public override bool CanConvert(Type objectType) { return true; } public override object ReadJson(JsonReader reader, Type objectType, JsonSerializer serializer) { throw new NotImplementedException(); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { writer.WriteRaw((string)value); } }
i keep getting an error saying it would result in invalid js whenever this is included.Code:[JsonConverter(typeof(JavascriptMethodConverter))] public virtual string Renderer { get; set; }
this seems like a standard use case to me - is there anything i'm doing wrong?
cheers
w://
-
20 Oct 2009 4:42 PM #100
Form returns with server error, even though everything appears to work!
Form returns with server error, even though everything appears to work!
ExtJS code to do post submit:
Serverside codeCode:f.submit ( { success: function(form, action) { debugger; if (action.result.Success) { if (action.result.Tags != null) { var newTags = action.result.Tags; for (var iTag = 0; iTag < newTags.length; iTag++) { var TagData = kbForum.ThreadView.Tags[params.ThreadId]; var newTags = action.result.Tags; if (Ext.isDefined(TagData.TagIdIndex[newTagId])) { TagData[TagData.TagIdIndex[newTagId]] = newTags[iTag]; } else { TagData.TagIdIndex[newTags[iTag].TagID] = TagData.length; TagData.TagNameIndex[newTags[iTag].TagName] = TagData.length; TagData.push(newTags[iTag]); } } } if (Ext.isDefined(kbForum.EditorParams.onSave)) kbForum.EditorParams.onSave(action.result); kbForum.CloseEditor(); } }, failure: function(form, action) { debugger; //arrives here with a "server" failure result. //the data is actually returned correctly, everything works. } } );
Code:[FormHandler] [ValidateInput(false)] public ActionResult SavePost() { string Title = Request.Form["PostTitle"]; string PostBody = Request.Form["PostBody"]; string Tags = Request.Form["Tags"].ToLower(); Dictionary<string, string> start = null; List<CommunityTagMember> UpdatedTags = null; int PostId = -1; int PageSize = Utility.FixNullInt(Request.Form["PageSize"],5); bool bSuccess = true; int ThreadId = Utility.FixNullInt(Request.Form["ThreadId"], -1); //snip – a whole bunch of code here, all of which runs just fine. It may //be a lot of code, but I doubt that it is timing out. var result = new { Success = bSuccess, Tags = UpdatedTags, PostId = PostId, Start = start }; // the code returns all of the way to here, but it isn't possible // to follow this into the Direct() function without reconfiguring // the project return Direct(result); }


Reply With Quote