Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

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

      0  

    Default


    Any idea why I would be getting the following error?

    Stack Trace:
    Code:
    [MissingMethodException]: Method not found: 'Void System.Web.Mvc.ControllerBase.set_ValueProvider(System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult>)'.
       at Ext.Direct.Mvc.DirectMethodInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
       at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
       at System.Web.Mvc.Controller.ExecuteCore()
       at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
       at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
       at Ext.Direct.Mvc.DirectProvider.ExecuteRequest(RequestContext requestContext, DirectRequest request)
       at Ext.Direct.Mvc.DirectProvider.Execute(RequestContext requestContext)
       at Ext.Direct.Mvc.DirectController.Router()
       at lambda_method(Closure , ControllerBase , Object[] )
       at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
       at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a()
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
       at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c()
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
       at System.Web.Mvc.Controller.ExecuteCore()
       at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
       at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
       at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__4()
       at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
       at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    Trying to do very simple SayHello() call to controller. Api is generated just fine:
    Code:
    Ext.app.REMOTING_API={
      "url": "/Direct/Router",
      "type": "remoting",
      "actions": {
        "Contact": [
          {
            "name": "SayHello",
            "len": 0
          },
          {
            "name": "List",
            "len": 0
          }
        ]
      }
    };
    Copied SimpleTestPanel.js into my project and trying to call SayHello action in controller ContactController. Called like so in my SimpleTestPanel.js:
    Code:
            Contact.SayHello(function(result, response) {
                this.updateBody(result);
            }, this);
    MVC assembly name is ContactManager and the following is in the web.config:
    Code:
      <configSections>
        <section name="ext.direct" type="Ext.Direct.Mvc.Configuration.DirectSection, Ext.Direct.Mvc"/>
      </configSections>
    
      <ext.direct providerName="Ext.app.REMOTING_API" assembly="ContactManager" dateFormat="Iso" debug="true"/>
    I have tried other methods etc. and all come back with the same error shown above. I also see "Unable to communicate with server." in client side debug as as the top most error, but could just be because something is failing on the server. When I call the method, it gets into the constructor of the Controller (using Dependency injection) but I get the above error before it ever gets to the action called (SayHello).

    This has gotta be a setup issue, but cannot determine what as I thought I followed all instructions to the letter.

    Thanks...

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

      0  

    Default


    Just a quick thought. Though the Ext.Direct for ASP.NET MVC Wiki documentation does say that it would prudent to mark ALL controllers with [DirectIgnore] whose actions are not needed in the client side API, it might help to mention that the DirectProvider will fail if you don't mark the AccountController with the DirectIgnore or remove the controller altogether. It is created by default on MVC 2 projects so it must be dealt with one way or the other. Not sure if this is new to MVC 2.0 or not....but if not handled one of the two ways mentioned, the addProvider method will fail, and you will get the cryptic Javascript "null events" message.

  3. #253
    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 Bucs View Post
    Just a quick thought. Though the Ext.Direct for ASP.NET MVC Wiki documentation does say that it would prudent to mark ALL controllers with [DirectIgnore] whose actions are not needed in the client side API, it might help to mention that the DirectProvider will fail if you don't mark the AccountController with the DirectIgnore or remove the controller altogether. It is created by default on MVC 2 projects so it must be dealt with one way or the other. Not sure if this is new to MVC 2.0 or not....but if not handled one of the two ways mentioned, the addProvider method will fail, and you will get the cryptic Javascript "null events" message.
    Thank you, it's a very good point. I've added a note to the end of Usage section.

    Regarding your previous post, I really don't know what can cause this error. I have to see the setup.

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

      0  

    Default


    Thanks Eugene. I rebuilt the project and am not getting that error anymore. I am still having one problem...wasn't sure if this was specific enough to this Ext.Direct ASP.NET MVC thread or not...so if not, please feel free to remove.

    I am trying to decouple my MVC application as suggested by MS tutorials. I found that it's not really needed (or fun) to try and segregate the Controllers from the UI...unless it is absolutely necessary like for huge multi-team projects. However, I do see a few reasons to have the data layer in a separate projects, but I am having a helluva time getting it to work.

    I am able to get Ext.Direct to work as expected against an EntityFramework Model when the EF model is placed in the Models folder of the same MVC project. However, when I created a separate project (Class Library) and copy all the service (business logic interface and concrete implementations) and data access files (repository interface and concrete implementations) into the separate project, create a ref to that project in the MVC project, I get the following error:

    Code:
    An error occurred when trying to create a controller of type 'ContactManager.Controllers.ContactController'. Make sure that the controller has a parameterless public constructor.
    I am using a service layer (not web service, just term for business classes) and a repository pattern. So when the application starts, the Ext.Direct.Mvc kicks in to create the API which I'm guessing needs to create the Controllers. So, default.aspx page view is hit and fires the "httpHandler.ProcessRequest(HttpContext.Current);" line which then begins to instantiate the one Controller I have in the project like so:

    Code:
    namespace ContactManager.Controllers
    {
        public class ContactController : Controller
        {
            private IContactManagerService _service;
    
            public ContactController()
            {
                _service = new ContactManagerService(new ModelStateWrapper(this.ModelState));
            }
    
            public ContactController(IContactManagerService service)
            {
                _service = service;
            }
            .......
    The constructor code in the Controller then needs to instantiate the Service layer in the Models namespace so the data can be retrieved from the repository. So, after creating a quick ModelStateWrapper the above call instantiates the ContactManagerService as follows:

    Code:
        public class ContactManagerService : IContactManagerService
        {
            private IValidationDictionary _validationDictionary;
            private IContactManagerRepository _repository;
    
    
            public ContactManagerService(IValidationDictionary validationDictionary) 
                : this(validationDictionary, new EntityContactManagerRepository())
            {}
    
    
            public ContactManagerService(IValidationDictionary validationDictionary, IContactManagerRepository repository)
            {
                _validationDictionary = validationDictionary;
                _repository = repository;
            }
            .......
    This in turn needs to spin up a copy of the EntityContactManagerRepository so the actual database CRUD calls can be made. So that call is made:

    Code:
        public class EntityContactManagerRepository : ContactManager.Models.IContactManagerRepository
        {
            private ContactManagerEntities _entities = new ContactManagerEntities();
            .........

    This in turn instantiates the EF Model for the repository which point to a SQL Server database. It is in the definition line of the first constructor of the EntityContactManagerRepository class where the process fails with the error mentioned above:

    Code:
        public partial class ContactManagerEntities : ObjectContext
        {
            #region Constructors
        
            /// <summary>
            /// Initializes a new ContactManagerEntities object using the connection string found in the 'ContactManagerEntities' section of the application configuration file.
            /// </summary>
            public ContactManagerEntities() : base("name=ContactManagerEntities", "ContactManagerEntities") <== errors out here
            {
                this.ContextOptions.LazyLoadingEnabled = true;
                OnContextCreated();
            }
            ........
    Again, I would love to be able to use the EF Model and have this in a separate project for clarity....but not able to get around this error message yet. Again, if I copy all this code back into the MVC Project in the Models directory...and recreated the EF Model...it immediately works again. So, not sure if this is a problem with the Class Project instantiating the DB or an HttpContext passing issue, or what. When I create the EF Model in the separate project, at creates the app.config and the necessary connection string without any problems, so can'r see that as being the issue...hmm.

    Any ideas? Thx...

  5. #255
    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 Bucs View Post
    Any ideas? Thx...
    Sorry, no ideas here. I've never done anything with Entity Framework

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

      0  

    Default


    FWIW, it was an EF specific issue with the connection string. I did not create a "Models" folder in the separate class library project where I created the new SQL Server EF Model, but rather generated the model in the root of that project. I had also left the orignal connection string in the web.config of the MVC project which originally had a Models folder when the SQLExpress EF model was created. This old connection string was taking precedence over the app.config connection string in the Model project. After looking at the connection strings, I noticed that there was a "Models." prefix pointer on the web.config conn string so that was making the EF look for the Models in a model specific folder, which didn't exist.

    Bottom line, if you're using the EntityFramework and you want to separate out your Models into their own project, generate the model in that project and copy the resulting connection string back into the web.config of the MVC project.

    The dreaded "learning curve" strikes again

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

      0  

    Default


    Loving Ext.Direct.MVC...client-side JS is so clean now!

    Question. How can I add multiple result sets to a ActionResult response from the server? Say I have the following server action:
    Code:
            public ActionResult LoadContact()
            {
                // Get a contact
                var contact = _service.GetContact(3);
                return this.Direct(new
                {
                    success = true,
                    data = contact
                });
            }
    If the Contact form that I will be loading this into has a State field, I want to retrieve all the states along with the form data and first load the States into the State field, then use setValues() on the form from the contact data. So if I have another method in the "_service" business class called GetStates(), would the following work and is this the recommended approach?
    Code:
            public ActionResult LoadContact()
            {
                // Get a contact
                object[] formData = new object[2];
                formData[0] = _service.ListStates();
                formData[1] = _service.GetContact(3);
    
                return this.Direct(new
                {
                    success = true,
                    data = formData
                });
            }
    Or, is the best practice to fire multiple (batched) requests directly from the client to accomplish this type of task? With that approach, I am worried that the form data may sometimes return before the necessary states data, though I have read that the batched requests will be processed in the order called.

    Thanks

    UPDATE: This seems to work fine, so I'll use it unless someone else has a better idea or if there is a another way to return multiple results using Ext.Direct.Mvc that I'm missing.

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

      0  

    Default


    BUCS, you can do anything you want with the return object eg
    return this.Direct(new
    {
    success = true,
    data = formData
    foo = foo,
    bar = bar,
    baz = baz
    });

    as long as formdata, foo, bar and baz can be serialized to JSON. You probably want to map your entities to simple dtos if they have complex associations/collections however before sending over the wire.

    You can do really cool stuff with this.. I have a very complex form with a few grids and some combos on it and I want to load the data for the form and the grids & combos in one hit.. easily done:

    Code:
    <SNIP>
    loadAfterRender: function (id) {
            this.el.mask('Please wait...', 'x-mask-loading');
            this.getForm().load({
                params: {
                    id: id
                },
                failure: this.onLoadFailure,
                success: this.onLoadSuccess,
                scope: this
            });
        },
        onLoadFailure: function (form, action) {
            this.el.unmask();
            var result = action.result;
            Ext.MessageBox.alert('Failure', result.message);
            this.clearForm();
        },
        onLoadSuccess: function (form, action) {
            this.el.unmask();
            var foo = action.result.foo;
            if (foo) {
                //do stuff with the data
                //eg bind grid store to it
            }
            var bar = action.result.bar;
            if (bar){
              //do stuff with combos
            }
        },
    </SNIP>


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

      0  

    Default


    Bucs, sorry I couldn't reply sooner. Was extremely busy.
    Now regarding your question. You can return anything you want from the server - simple types, arrays, objects... anything that Json.NET can serialize. However, as you know, when you are loading a form in Ext JS, you must return an object, that contains success and data. If you want to return additional information, just add it as a property to the object on the server. Suppose you have State class:
    Code:
    public class State {
        public string Code { get; set; }
        public string Name { get; set; }
    }
    Then your controller action to load contact form could look something like this:
    Code:
    public ActionResult LoadContact() {
        Contact contact;
        State[] states;
    
        // initialize contact and states...
    
        return this.Direct(new {
            success = true,
            data = contact,
            states = states
        });
    }
    Then on the client when you load the Contact form you can read the value of states and use it to populate the state combo-box. The combo can be configured like this:
    Code:
    {
        xtype: 'combo',
        itemId: 'state',
        name: 'state',
        hiddenName: 'state',
        fieldLabel: 'State',
        mode: 'local',
        triggerAction: 'all',
        store: new Ext.data.Store({
            reader: new Ext.data.JsonReader({
                fields: ['Code', 'Name']
            })
        }),
        valueField: 'Code',
        displayField: 'Name'
    }
    But you have to remember, that callback functions are called after the form sets the values of the fields, so you should also call assertValue() method of the combo-box after populating it, so that it will show the name of the state instead of a code.

    Hope this helps.

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

      0  

    Default


    Thanks Eugene, agree on using a separate property for other data sources rather than commingle in data property as that will not allow the auto population of form values with a standard getform().submit() call. So, I was not using the api{ load: Contact.LoadContact} property but rather using a standard button handler like so:

    Code:
                        Contact.LoadContact(function(result, response) {
                            Ext.getCmp('State').getStore().loadData(result.data[0])
                            this.getForm().setValues(result.data[1]);
                        }, this);
    I wasn't quite clear where to handle the response if I used the direct api config syntax for the load. I knew I could put a listener on the form load but was worried about the combo values not being available. I never knew about the assertValue() method So, then I should just put a listener on the form load, load the combo, then use the assertValue()? Will this cause a flash between the form value and display value though?

    Thanks...