asp.net mvc - MVC Submit button action -
i have little problem submit button action. know question not new , saw many answers such kind of questions, still can't understand wrong.
view:
<form asp-action="tablesettings"> <p>please, select rows count tabe in tab "orders"</p> @html.dropdownlistfor(x => x.selectedid, model.rows) <input id="submit" type="submit" value="submit" name="submit" /> </form>
controller:
[httppost] public actionresult submit(string submit, mymodel model) { settings settings = _context.settings.firstordefault(); int id = model.selectedid; settings.value = id.tostring(); _context.savechanges(); return view(); }
after click button nothing changed. dropdownlist reset. that's all.
p.s. please, don't beat me ))
so, problem in wrong asp-action name. everyone. next time check more attentively.
should
asp-action="submit"
Comments
Post a Comment