How to pass values to controller from Javascript code in MVC

后端 未结 3 483
一向
一向 2021-01-07 01:32

Actually I have a scenario like :

I am getting the values of checked records in GridView through Javascript. Now i need to send those values to controller for deleti

3条回答
  •  暖寄归人
    2021-01-07 01:50

    Consider the following example i am firing the script with a list value using for loop table data.

      
    

    the function to pass values to controller from Javascript code in MVC

    
    

    in to the controller

     public ActionResult ServiceOutDelete(string id, ServiceOutModels model)
            {
               // id will contailn the value of parameter
               // AS you want
                return View("ServiceOutViewDetails", model);
            }
    

提交回复
热议问题