I have a function CreatePerson(int id)
, I want to pass id
from @Url.Action
.
Below is the reference code:
public ActionResult CreatePerson(int id) //controller
window.location.href = "@Url.Action("CreatePerson", "Person") + id";
the above code fails to pass id
value to CreatePerson
function.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…