コード例 #1
0
        /// <summary>
        ///     MVCs the grid.
        /// </summary>
        /// <param name="helper">The helper.</param>
        /// <param name="name">The name.</param>
        /// <returns>IHtmlString.</returns>
        /// TODO Edit XML Comment Template for MvcGrid
        public static IHtmlString MvcGrid(this HtmlHelper helper, string name)
        {
            var currentMapping =
                MvcGridDefinitionTable.GetDefinitionInterface(name);

            return(MvcGrid(helper, name, currentMapping, null));
        }
コード例 #2
0
        /// <summary>
        /// Handles the table.
        /// </summary>
        /// <param name="context">The context.</param>
        /// TODO Edit XML Comment Template for HandleTable
        private static void HandleTable(HttpContext context)
        {
            var gridName = context.Request["Name"];
            var grid     = MvcGridDefinitionTable.GetDefinitionInterface(gridName);
            var options  = QueryStringParser.ParseOptions(grid, context.Request);

            var gridContext =
                GridContextUtility.Create(context, gridName, grid, options);

            var engine = new GridEngine();

            if (!engine.CheckAuthorization(gridContext))
            {
                context.Response.StatusCode = 403;
                context.Response.End();
                return;
            }

            var renderingEngine = GridEngine.GetRenderingEngine(gridContext);

            renderingEngine.PrepareResponse(context.Response);
            engine.Run(renderingEngine, gridContext, context.Response.Output);
        }