Umbraco的searchresult导致404页而非“搜索结果”页

时间:2018-06-25 02:43:27

标签: javascript jquery razor umbraco umbraco7

使用搜索表单获取结果列表时,它会转到404页面未找到,而是搜索结果页面。

Search Results.cshtml是

<form action="/searchresult/" method="GET">
        <input type="text" class="searchfield" placeholder="" name="query">
        <button class="searchbtn btn btn-default btn-sm">Search</button>
    </form>

     @{
        var searchQuery = Request.QueryString["query"];

        if (!string.IsNullOrEmpty(searchQuery))    
        {
            <div class="searchresults">
                <p class="intro-para">Your search results for <strong>"@searchQuery"</strong></p>
                <ul>
                    @foreach (var result in Umbraco.Search(searchQuery))
                    {

                        <li>

                            <a class="heading1 inline-link" href="@result.Url">@result.Name</a>
                            <div  class="heading2">Created Date : @result.CreateDate.ToLongDateString()</div>
                            <div  class="heading2">Updated Date : @result.updateDate.ToLongDateString()</div>
                        </li>
                    }
                </ul>
            </div>
         }
    } 

http://gmohan:8018/searchresult/?query=loan

enter image description here

还有其他人遇到此错误并找到解决方法吗?

0 个答案:

没有答案