Ejemplo n.º 1
0
        private void ProcessDataSource()
        {
            if (Pageable.Enabled && DataSource.PageSize == 0)
            {
                DataSource.PageSize = 10;
            }

            var binder = new DataSourceRequestModelBinder();

            if (this.PrefixUrlParameters)
            {
                binder.Prefix = Name;

                if (DataSource.Type == DataSourceType.Server)
                {
                    DataSource.Transport.Prefix = Name + "-";
                }
            }

            var controller     = ViewContext.Controller;
            var bindingContext = new ModelBindingContext()
            {
                ValueProvider = controller.ValueProvider
            };

            var request = (DataSourceRequest)binder.BindModel(controller.ControllerContext, bindingContext);

            DataSource.Process(request, !EnableCustomBinding);

            if (DataSource.Schema.Model.Id != null)
            {
                DataKeys.Add(DataSource.Schema.Model.Id);
            }
        }
Ejemplo n.º 2
0
        private void ProcessDataSource()
        {
            var binder = new DataSourceRequestModelBinder();

            var controller     = ViewContext.Controller;
            var bindingContext = new ModelBindingContext()
            {
                ValueProvider = controller.ValueProvider
            };

            var request = (DataSourceRequest)binder.BindModel(controller.ControllerContext, bindingContext);

            DataSource.Process(request, true /*!EnableCustomBinding*/);
        }