ActionLink generate empty href using MVC 5 with Umbraco 7

孤者浪人 提交于 2019-12-13 06:00:48

问题


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:


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



来源:https://stackoverflow.com/questions/33035660/actionlink-generate-empty-href-using-mvc-5-with-umbraco-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!