Pass Textbox Value From View To Buttons May 29, 2024 Post a Comment View: @using (@Html.BeginForm('Show', 'test', FormMethod.Post)) { Solution 1: Try this,<inputtype="button" value="Show" onclick = "location.href='@Url.Action("Show", "Foo")'"/> <inputtype="button" value="Go" onclick = "location.href='@Url.Action("Go", "Foo")'"/> CopyUPDATE:As type="button" does not submit the values in the form, its not directly possible to do what you have asked, the better idea is to Identify the Button that has been clicked in the controller method as show in this link Solution 2: Try thisBaca JugaHow Can I Strip Html Tags In C#Can't Get Xpath Working With Html Agility PackItextsharp Htmlworker.parsetolist() Throws Nullreferenceexception<inputtype="button" value="Show" onclick="location.href='<%: Url.Action("Show", "Controller") %>'" /> <inputtype="button" value="Go" onclick="location.href='<%: Url.Action("Go", "Controller") %>'" /> CopySolution 3: Try something like:<inputtype="button" value="Show" onclick="location.href='<%:Url.Action("Show", "ControllerName")%>'"/> <inputtype="button" value="Go" onclick="location.href='<%:Url.Action("Go", "ControllerName")%>'"/> CopyIf you are posting more form data you can use Ajax, see Making a Simple Ajax call to controller in asp.net mvc Share You may like these postsIn My Mvc 5 Project, I Can't Access Static Html Page When Working On Local IisAsp.net Mvc + Populate DropdownlistEnable Browser Caching For Static ResourcesHow Can I Return An Empty List Instead Of A Null List From A Listboxfor Selection Box In Asp.net Mvc? Post a Comment for "Pass Textbox Value From View To Buttons"