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.
Related Contents:
- How do I write unencoded Json to my View using Razor?
- How do you redirect to a page using the POST verb?
- How to get MVC action to return 404
- how to add script src inside a View when using Layout
- Getting “A potentially dangerous Request.Path value was detected from the client (&)”
- ASP.NET MVC Controller Naming Pluralization
- How do I set the request timeout for one controller action in an asp.net mvc application
- ASP.NET MVC Html.DropDownList SelectedValue
- ASP.NET MVC – How to Preserve ModelState Errors Across RedirectToAction?
- What is routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”)
- Is it possible to create a generic @helper method with Razor?
- Mixing Angular and ASP.NET MVC/Web api?
- Purpose of ActionName
- Can I add a class to an HTML.ActionLink in MVC3
- How to add Date Picker Bootstrap 3 on MVC 5 project using the Razor engine?
- How to get filter to redirect to another action?
- Unit tests on MVC validation
- How to change ‘data-val-number’ message validation in MVC while it is generated by @Html helper
- Why doesn’t Visual Studio code formatting work properly for Razor markup?
- Default value in an asp.net mvc view model
- MVC 3 Can’t pass string as a View’s model?
- Multiple languages in an ASP.NET MVC application?
- How to get the HTML id generated by asp.net MVC EditorFor
- TemporaryGeneratedFile_[guid] in /obj/debug breaking build
- How to disable autocomplete in MVC Html Helper
- ASP.NET MVC: Custom Html Helpers in Razor
- Disable client-side validation in MVC 3 “cancel” submit button
- A public action method ‘..’ was not found on controller ‘..’
- How do I increase the maxUrlLength property in the config in asp.net MVC 3?
- razor views are not giving compile time error [duplicate]
- Context.User.Identity.Name is null with SignalR 2.X.X. How to fix it?
- Using System.ComponentModel.DataAnnotations with Entity Framework 4.0
- MVC project on VS2010 error : The project type is not supported by this installation
- Converting a ASP.NET MVC 3 Project to MVC 4
- MVC4 enum and radio button list
- how to implement ASP.NET Identity to an empty MVC project
- What does WebActivator do?
- Attribute Routing not working in areas
- ASP.NET MVC – Removing controller name from URL
- ASP.NET MVC bind array in model
- Set Focus on a Textbox – MVC3
- Challenges with selecting values in ListBoxFor
- How do I access the ModelState from an ActionFilter?
- benefit of using angular js on top of asp.net mvc
- Where can I find a list of escape characters required for my JSON ajax return type?
- Knockout + mvc 3 + Validation
- where is the best place to save images from users upload
- How to use a ViewBag to create a dropdownlist?
- How do I bypass the HTML encoding when using Html.ActionLink in Mvc?
- How to send a model in jQuery $.ajax() post request to MVC controller method