URL.Action includes id when constructing URL

前端 未结 3 707
眼角桃花
眼角桃花 2020-12-15 04:40

I\'m using ASP.Net MVC. Here\'s my code snippets from a controller named Course:

public ActionResult List(int id)
{
    var viewmodel.ShowUrl = Url.Action(\         


        
3条回答
  •  一整个雨季
    2020-12-15 05:21

    Just came across the same problem and so you know, you can also just use an empty string:

    @Url.Action("Show", "Course", new { id = "" })
    

提交回复
热议问题