MVC DropDownList OnChange to update other form fields

后端 未结 2 1672
余生分开走
余生分开走 2021-01-31 20:40

I am new to MVC (I am moving over from the dark side of traditional ASP.Net) and I know that SO is more of a \"why doesn\'t this work\" but, being new to MVC, I just wanted to

2条回答
  •  攒了一身酷
    2021-01-31 20:42

    1. Make a Controller "Action" that return "Json" data.
    2. Make Ajax call "onchange" of dropdown to that "Action".
    3. On ajax "response" (json) u will get values then set those values to fields from json response.

    This is the way to update field values.

提交回复
热议问题