How to pass a textbox value from view to a controller in MVC 4?

后端 未结 5 1407
我在风中等你
我在风中等你 2021-02-13 23:56

Here i am fetching the value from database and showing it in a input field


and

5条回答
  •  庸人自扰
    2021-02-14 00:32

    You can use simple form:

    @using(Html.BeginForm("Update", "Shopping"))
    {
        
        ...
        
    }
    

    And add here attribute:

    [HttpPost]
    public ActionResult Update(string id, string productid, int qty, decimal unitrate)
    

提交回复
热议问题