Hybrid View
-
23 Jun 2009 9:42 PM #1
Ext.Direct for ASP.NET MVC
Ext.Direct for ASP.NET MVC
Ext.Direct for ASP.NET MVC
Here is my implementation of Ext.Direct server-side stack for ASP.NET MVC 3 and 4.
Nov 12, 2012: The project has moves to GitHub.
Key features
* Easy setup
* Support for different types of parameters - simple types, complex types and arrays
* Form post values can be bound to multiple simple type parameters, a single complex type parameter (object) or a mix of both on the server
* Support for method aliases
* Exceptions with full stack trace and additional user-defined data for easy debugging
* Support for custom server-side events
* Support for named arguments (Ext JS 4.x)
The full source code is available here:
Ext.Direct for ASP.NET MVC on GitHub
Clone it or download the repository as zip file. You need to open the solutions in Visual Studio 2012 and allow NuGet to download missing packages before attempting to build it, as described in Compiling the source section in the README file.
Please read the README !!!
Any questions, comments, suggestions are welcome.Eugene
Ext.Direct for ASP.NET MVC
-
24 Jun 2009 1:42 PM #2
Very nice examples
I was thinking of converting my existing ExtJs MVc app to using Direct but I have not had time to look at using it
This is great to get me jump started
Questions
Does the DirectProvider class generate the DirectApi.js file and write it back to the response stream?
When does it do this? I noticed its cached if I add a new contoller will it automatically generate a new DirectApi.js file?
Does the router pick up all requests marked DirectRouter and then inspect the JSON and map the action to the controller and the method to the action?
-
24 Jun 2009 4:26 PM #3
Removed the comment. Its content was no longer valid in the latest version.
Last edited by elishnevsky; 23 Jan 2010 at 9:29 PM. Reason: Content removed
Eugene
Ext.Direct for ASP.NET MVC
-
25 Jun 2009 3:56 AM #4
Very nice examples and thank you for sharing.
Just one comment; testing using FireFox 3.0.11 everything works but using IE 7, the tree and the grid panel do not show - Error: Object expected, Char: 13, Line 7506.
Thanks a lot!
-
25 Jun 2009 8:59 AM #5
That's because I don't care about IE
But I fixed it anyways. Extra comma thing again, doh!
Just uploaded Ext.Direct.Mvc-0.2.zip. It requires you to make a small change in the configuration. Please change from this:
To this:HTML Code:<section name="ext.direct" type="Ext.Direct.Mvc.DirectSectionHandler, Ext.Direct.Mvc"/>
Also added extra exception handling and moved all configuration related stuff to Ext.Direct.Mvc.Configuration namespace.HTML Code:<section name="ext.direct" type="Ext.Direct.Mvc.Configuration.DirectSection, Ext.Direct.Mvc"/>
First post updated.Eugene
Ext.Direct for ASP.NET MVC
-
27 Jun 2009 6:19 PM #6
Uploaded version 0.3. Controller actions marked with DirectIgnoreAttribute (e.g. [DirectIgnore]) can now be executed as regular actions via the default route. Head post updated.
Eugene
Ext.Direct for ASP.NET MVC
-
27 Nov 2009 12:07 AM #7
ouch, totally missed that one.
Thanks!
-
3 Dec 2009 11:09 AM #8
Ext.Direct.Mvc v0.8.1 is released.
The download link is in the first post of this thread.
Changes:I have also removed the Ext JS source from the test application and instead linked the scripts from cachefly.net. The package is now much smaller.Code:* Remove: Interception of every exception introduced in v0.8.0 (was a bad idea). * Added: DirectHandleErrorAttribute class which can be used to mark a whole controller or an individual action with a [DirectHandleError] attribute to intercept all exceptions and return a direct response of type "exception" that contains the information about the exception. * Added: DirectException class for throwing custom exceptions that will always return to the client as a direct response of type "exception". * Added: Suport for ActionNameAttribute. If an action is marked with this attribute, then the specified name will be used when generating API and for routing direct requests. Make sure that you use the name specified in this attribute when calling the method from your JS code. * Added: New overloaded methods in DirectController. Check out DirectForm(). * Renamed: exceptionData to errorData. * Fixed: Serialization of DirectResponse in file upload mode. * Misc: Other minor fixes and code optimizations.
Thanks to the .NET expert and my colleague aritchie for pointing out the issues with catching all exceptions.Eugene
Ext.Direct for ASP.NET MVC
-
4 Dec 2009 10:50 PM #9
Uploaded Ext.Direct.Mvc v0.8.2.
See the first post of this thread for the download link.
Changes:Code:* Fixed: Binding DateTime, Enum, Guid and nullable types. * Misc: Lots of unnecessary code was removed.
Eugene
Ext.Direct for ASP.NET MVC
-
5 Dec 2009 5:43 PM #10
It seems with latest I have problems with passing GUID strings into server-side code. Earlier with version 7 I was able to invoke controller methods that had Guid parameters - now it is broken.
Same problem with DateTime, from JS I pass Javascript's Date type variable, on server I'm getting string representation, but your code in DirectMethodInvoker.GetParameterValues doesn't correctly handle this. It compares String to Nullable<DateTime> that i obviously wrong.
I think better would be to allow reflection do the job. Just handle JSON object deserialization, do not check types yourself.


Reply With Quote