ユーザーがMVCページをクリックしたときにMVCページに移動するリンクを作成しようとしています。現在私は持っています:
HTMLTable.AppendLine("<td class=\"team\"> " + tournament.TournamentRoundMatches[col][effective_match_id].competitorId1 + "<a href=\"<% =Html.BuildUrlFromExpression<CompetitionController>(c => c.Details(83)) %>\">" + " update" + "</a>" + "</td>");
ただし、これにより404エラーが発生し、次のリンクが生成されます。
localhost:52313/Tournament/Details/%3C%%20=Html.BuildUrlFromExpression%3CCompetitionController%3E(c%20=%3E%20c.Details(83))%20%%3E
私のコントローラーメソッドは次のようになります。
[Authorize]
public ActionResult Details(int id)
{
var competition = Competition.getCompetitionById(id);
return View(competition);
}
誰かが私が間違っているかもしれないことを見ていますか?