Matt's should work fine. If you are still passing in FormMethod.Post
, though, you need to do it like this:
Html.BeginForm("action","controller", new { Id = 12345 }, FormMethod.Post);
Reversing the third and fourth parameters will result in the Id
being treated as an attribute instead of a route value.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…