ASP MVC Passing value into modal window

后端 未结 3 915
旧时难觅i
旧时难觅i 2021-01-22 13:04

I have this view with a modal window. When I click to open the modal window, I\'d like to pass the parameter item.InstrumentId into the modal window so that I can c

3条回答
  •  不思量自难忘°
    2021-01-22 13:22

    Instrument:

    @Html.ActionLink("Link_Text", "Action_Name", "Controller_Name", new { id=item.InstrumentId})
    

    Now in your COntroller you can access this value like

    public ActionResult Action_Name(int id)
    {
        //Do something
        return view();
    }
    

提交回复
热议问题