问题
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