November Happy Hour will be moved to Thursday December 5th.

SearchPageController.cs missing from the project

Vote:
 

Hi,

I'm trying to create a page for that I need to use build in SearchPageController.cs but it is missing from controllers folder of the project.

Please help me to resolve this issue.

#261987
Sep 09, 2021 11:27
Vote:
 
using AlloySampleSite.Controllers;
using AlloySampleSite.Models.Pages;
using AlloySampleSite.Models.ViewModels;
using Microsoft.AspNetCore.Mvc;
using System.Linq;

namespace AlloySampleSite.Controllers
{
    public class SearchPageController : PageControllerBase<SearchPage>
    {
        public ViewResult Index(SearchPage currentPage, string q)
        {
            var model = new SearchContentModel(currentPage)
            {
                Hits = Enumerable.Empty<SearchContentModel.SearchHit>(),
                NumberOfHits = 0,
                SearchServiceDisabled = true,
                SearchedQuery = q
            };

            return View(model);
        }
    }
}
#261990
Sep 09, 2021 11:51
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.