1. #1
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      1  

    Default 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.

  2. #2
    Sencha User
    Join Date
    Apr 2008
    Location
    West Linton, Scotland
    Posts
    244
    Vote Rating
    0
    andycramb is on a distinguished road

      0  

    Default


    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?

  3. #3
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    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

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    14
    Vote Rating
    0
    Razhick is on a distinguished road

      0  

    Default


    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!

  5. #5
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      1  

    Default


    Quote Originally Posted by Razhick View Post
    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!
    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:
    HTML Code:
    <section name="ext.direct" type="Ext.Direct.Mvc.DirectSectionHandler, Ext.Direct.Mvc"/>
    To this:
    HTML Code:
    <section name="ext.direct" type="Ext.Direct.Mvc.Configuration.DirectSection, Ext.Direct.Mvc"/>
    Also added extra exception handling and moved all configuration related stuff to Ext.Direct.Mvc.Configuration namespace.

    First post updated.

  6. #6
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    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.

  7. #7
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    Uploaded version 0.4. You can now use [DirectIgnore] attribute to also mark classes (controllers) for ignore. This is useful if you need to create an abstract controller that itself uses DirectController as a base class.

  8. #8
    Ext User
    Join Date
    Nov 2008
    Location
    Oakland, CA
    Posts
    155
    Vote Rating
    0
    mohaaron is on a distinguished road

      0  

    Default


    Nice work. I'm going to start building some test cases using this. Thanks for the examples and code.

  9. #9
    Sencha User
    Join Date
    Mar 2007
    Posts
    764
    Vote Rating
    1
    franklt69 is on a distinguished road

      0  

    Default


    Hi elishnevsky's , in your example you have only one view (index.aspx), is it the right approach? I mean, could you give more details about the view and javascript using this approach, what about if you have many aspx page in your app?

    maybe is trivial but I am confused

    regards
    Frank

  10. #10
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    Quote Originally Posted by franklt69 View Post
    Hi elishnevsky's , in your example you have only one view (index.aspx), is it the right approach? I mean, could you give more details about the view and javascript using this approach, what about if you have many aspx page in your app?

    maybe is trivial but I am confused

    regards
    Frank
    When using Ext JS to develop a web application, it is usually the most common practice to only have one page and have all your markup generated by Ext JS. Therefore my current Ext.Direct implementation sort of follows this practice. However, you can still have more than one view and include the same API in all of them. You will just end up having some client-side methods in one view that you will never call, because they are meant to be used in another view.
    As I wrote in one of my previous posts, I'm planning to support multiple providers in the future, just can't tell exactly when yet.