1. #271
    Ext User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    bwaters is on a distinguished road

      0  

    Default


    Eugene,

    About six months ago, I was working on a project that used this component. Specifically, I was using 0.8.2. At the beginning of June, the project was mothballed (and so was the machine). Well, we have a need to bring it back to life. When I fired up the machine, the app would not run (but did load without a problem) because apparently, I had used an evaluation copy of Sql Server 2008 that had expired, so I loaded up Sql Server 2008 R2. I tried loading the project to change the connection string in the web.config and realized that I was also using an evaluation copy of Visual Studio 2010. So, I installed a current version. I modified the web.config copied it to the web site (i did not re-deploy the whole project). I restarted the web site and attempted to access the app and only got a blank page. Ultimately, what I found was that Ext.app.REMOTING_API was undefined (it was failing in the addProvider call). All I can assume is the installing the new components must have changed something.

    I really don't want to have to plug in the current version if I don't have to.

    Any ideas?

    Thanks, Brian.

  2. #272
    Sencha Premium Member
    Join Date
    Sep 2008
    Posts
    710
    Vote Rating
    6
    Bucs is on a distinguished road

      0  

    Default


    Brian,

    I would suggest you load the ASP.NET MVC source code as a project in your current app, remove the static Ext.Direct.Mvc DLL and point to the one form the source code bin dir. Then you can step into the source of the addProvider call and probably get more info as to why it's failing.

    Also, make sure that you have marked the AccountController with the [DirectIgnore] attribute if you have one, or remove it altogether. MS started adding that controller to 2010 projects at some point and the addProvider call blows up when trying to create an Api for it.

    HTH

  3. #273
    Sencha User
    Join Date
    Jun 2010
    Posts
    47
    Vote Rating
    0
    dan_b is on a distinguished road

      0  

    Default


    Quote Originally Posted by Bucs View Post
    Also, make sure that you have marked the AccountController with the [DirectIgnore] attribute if you have one, or remove it altogether.
    I say just remove the damn thing altogether.

  4. #274
    Sencha Premium Member
    Join Date
    Sep 2008
    Posts
    710
    Vote Rating
    6
    Bucs is on a distinguished road

      0  

    Default


    Agreed, the membership provider is kinda narly anyway, I wouldn't use it.

  5. #275
    Ext User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    bwaters is on a distinguished road

      0  

    Default


    Well, I bit the bullet and decided to try just upgrade to the current version of Ext.Direct.MVC and without upgrading extjs (using version 3.1.1). Had to update all of the controllers because of the change to Direct() and the removal of DirectForm(). I was quite pleased that the app came up and worked without any additional changes.

    I am actually using the AccountController and the methods were generated just fine.

    Thanks for the suggestions.

  6. #276
    Ext JS Premium Member veenvliet.morion's Avatar
    Join Date
    Oct 2009
    Location
    Netherlands
    Posts
    24
    Vote Rating
    0
    veenvliet.morion is on a distinguished road

      0  

    Default


    You don't use membership at all? How do you do authentication, and working with [Authorize] Attribute?
    Because of the [Authorize] attribute I work with the membership provider, or do you have another way to accomplish this?

  7. #277
    Ext User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    bwaters is on a distinguished road

      0  

    Default


    I created a CustomAuthorize attribute that I use through out the controllers instead of the Authorize attribute. First it calls base.AuthorizeCore() and then it adds a custom header to the response that tells the client the result of the base.AuthorizeCore() call. The override of AuthorizeCore() then returns true.

    Code:
    public class CustomAuthorizeAttribute : AuthorizeAttribute
    {
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
             bool result = base.AuthorizeCore(httpContext);
             httpContext.Response.AddHeader("authorizationTimeout", result ? "false" : "true");
             return true;
        }
    }
    Always returning true from this method prevent being redirected to a different page and then allows the user to log back in an pick up where they left off.

    Then in the client, I added the following:

    Code:
    Ext.data.Connection.on('requestcomplete', function (con, response, options) {
        if (Ext.isFunction(response.getResponseHeader)) {
            var authTimeout = response.getResponseHeader('authorizationTimeout');
    
            if (authTimeout === 'true' && !Ext.isDefined(Ext.ComponentMgr.get('login-box'))) {
                app.startLogin();
            }
        }
    });
    I am using Forms authentication and have set the timeout to a long period (2880). Then, on the client side, I have a local timeout such that if there is no activity for a certain amount of time, 20 minutes, the client will be prompted to log in again (while retaining their work). The user should be prompted to log in because of the client timeout long before the authentication times out on the server.

    I am sure that there are other ways of handling this, but this is how I did it....

  8. #278
    Ext JS Premium Member veenvliet.morion's Avatar
    Join Date
    Oct 2009
    Location
    Netherlands
    Posts
    24
    Vote Rating
    0
    veenvliet.morion is on a distinguished road

      0  

    Default


    Interesting method. But does your controller still give back all the requested data? That would be a security hole, I think?

  9. #279
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    373
    Vote Rating
    8
    ttbgwt is on a distinguished road

      0  

    Default


    Congratulations Eugene. The work you have done is very impressive. Thanks!

    Your example ran fine but I did get this build warning...

    Warning 3 'System.Web.Mvc.ValueProviderDictionary' is obsolete: 'The recommended alternative is to use one of the specific ValueProvider types, such as FormValueProvider.' C:\Users\ttb\Downloads\Ext.Direct.Mvc-2.1.0\Source\Ext.Direct.Mvc\DirectMethodInvoker.cs 44 41 Ext.Direct.Mvc

  10. #280
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    373
    Vote Rating
    8
    ttbgwt is on a distinguished road

      0  

    Default


    Hi,

    When direct batches calls, do they run in a specific order on the server? In the example below will onSayHello run on the server before onEchoDate runs?

    Code:
        onBatch: function() {
            this.onSayHello();
            this.onEchoDate();
            this.onAddNumbers();
            this.onEchoPerson();
        },