how to pass parameter from @Url.Action to controller function

后端 未结 10 790
一生所求
一生所求 2020-12-02 19:42

I have a function CreatePerson(int id) , I want to pass id from @Url.Action.

Below is the reference code:

pub         


        
10条回答
  •  -上瘾入骨i
    2020-12-02 20:16

    This way to pass value from Controller to View:

    ViewData["ID"] = _obj.ID;
    

    Here is the way to pass value from View to Controller back:

    
    

提交回复
热议问题