samedi 25 mars 2017

WebGrid Search Exception - Error executing child request for handler

I want to make Search in WebGrid but it doesn't work.

I have 2 methods in Controller

 [HttpGet]
    public async Task<ActionResult> ICare()
    {.... return View(tuple);}
[HttpPost]
    public async Task<ActionResult> ICare(string Search)
    {.... return View(tuple);}

And in View I have

using (Html.BeginForm("ICare", "Communities"))
    {
        <div class="row">
            <div class="patientsearch">
                <div class="col-xs-6 col-md-3">
                    <div class="form-group">
                        <div class="input-group">
                            @Html.TextBox("Search", "", new {placeholder = "Search My Patients", @class = "form-control"})
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn_green">Search</button>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        var grid = new WebGrid(Model.Item1, canSort: false, canPage: true, rowsPerPage: 10);
        <div class="table-responsive">
            @grid.GetHtml(
                mode: WebGridPagerModes.All,
                tableStyle: "table table-hover table-condensed",
                rowStyle: "table-row-clickable",
                headerStyle: "webgrid-header",
                footerStyle: "table-pager",
                columns:
                    grid.Columns(....

But it always throw an exception in Layout in this

 @{
                          Html.RenderAction("GetUserInfoForMenu", "Menu", new { Area = ""});
                        }

Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper

Aucun commentaire:

Enregistrer un commentaire