How do I append a variable to a string in an ActionLink?

后端 未结 2 542
孤城傲影
孤城傲影 2021-01-24 03:39

I keep getting a Compilation Error and can\'t find matching overloaded method. I\'ve tried a couple ways (variable, variable.toString). Below is the latest try.

When I

2条回答
  •  心在旅途
    2021-01-24 04:08

    This should work

    @Html.ActionLink(@startCount.ToString,"Index","Yourcontroller",new { day=@startCount.ToString()} , null)
    

    replace Yourcontroller with your controller name

提交回复
热议问题