ASP.NET MVC - Extract parameter of an URL

后端 未结 6 1936
轮回少年
轮回少年 2020-12-12 20:26

I\'m trying to extract the parameters of my URL, something like this.

/Administration/Customer/Edit/1

extract: 1

/Adm

6条回答
  •  春和景丽
    2020-12-12 20:55

    In order to get the values of your parameters, you can use RouteData.

    More context would be nice. Why do you need to "extract" them in the first place? You should have an Action like:

    public ActionResult Edit(int id, bool allowed) {}
    

提交回复
热议问题