ActionLink generate empty href using MVC 5 with Um

2019-09-09 14:07发布

I am using MVC 5 with Umbraco 7. Trying to use ActionLink in my View but the markup it generates have empty href. any idea how to get it working?

<a href="">Start Date</a>

View:

@Html.ActionLink(
      "Start Date",
      "SearchV1",
      "SearchV1",
      new { sitetypeid = @Request.QueryString["sitetypeid"], leaNo = @Request.QueryString["leaNo"], orderBy = "VacStart" },
      null)

Controller:

public class SearchV1Controller : RenderMvcController
{
    public override ActionResult Index(RenderModel model)
    {
        return base.Index(model);
    }

    public ActionResult SearchV1(RenderModel model, int sitetypeId , int leaNo, string orderBy = "VacRelDate")
    {
        List<GetJobSearchResults_Result> searchResultsList = Workflow.Vacancy.GetJobSearchResults(sitetypeId , leaNo, "SCH", orderBy, "desc");
        ViewBag.leaNo = leaNo;
        return View(searchResultsList);
    }
}

1条回答
来,给爷笑一个
2楼-- · 2019-09-09 15:04

This cannot be possible in Umbraco unless you inherit your controller class from Surface controller.

查看更多
登录 后发表回答