mardi 26 janvier 2016

Returning a sitecore item with populated model from controller action

I have a controller rendering on my homepage which is a search box.

My controller action looks like this

public ActionResult Search(SearchResultModel model)
    {
        //TODO bind to model to form
        SearchModel resultModel = new SearchModel
        {
            Keyword = Request.Form["keyword"]
        };
        var results = new List<SearchResultModel>();
        results = FoundResults(resultModel.Keyword);
        resultModel.SearchResults = results;

        return View(resultModel);
   }

What is it I want? I want to fill in a keyword in the input box have it processed ( and posted ) and return a page ( item ) in sitecore with my model. Something like return item and give it my model.

Question. Is this possible ?

If not? What would be the best way to tackle this issue?

I need some help here folks :).

I have already read :

http://ift.tt/1KC94jN

and other articles from Martina but I seem to not be getting anywhere closer.

Aucun commentaire:

Enregistrer un commentaire