Link to home
Start Free TrialLog in
Avatar of danielolorenz
danielolorenz

asked on

How Do You Recall Your MVC Page With Search Results From a Edit Page?

I need to recall my search page with the search results from my edit page click.

I need to activate the search page and display all search results from a different page.

Is there a way to display the page again and view the results from the last search while utilizing the UpdateTargetId?

Search Form
@using (Ajax.BeginForm("GunPermitSearch", null, new AjaxOptions
{
    HttpMethod = "POST",
    InsertionMode = InsertionMode.Replace,
    UpdateTargetId = "gun-permit-search-results",
    OnComplete = "onSearchComplete"
}, null))
{
        <div id="gun-permit-search-buttons">
            @{ Html.RenderPartial("_SearchButton", "search-btn-person"); }
            @{ Html.RenderPartial("_NewSearchButton", "new-search-button"); }
        </div>

        <div id="gun-permit-search-results">


        </div>

Open in new window


Controller:
[HttpPost]
        [AjaxOnly]
        public ActionResult GunPermitSearch(SearchModel searchModel, string submit)
        {
       //return PartialView("_ApplicantsResults", result);  
            return PartialView("_ApplicantsResults", applicantViewModel); 

Open in new window


Thanks,

Dan
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial