且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将模型存储到变量

更新时间:2023-01-06 22:39:06

如果您希望在提交表单时保留您的模型属性然后他们需要在一个表格领域。如果您不希望它们显示,则使用Html.HiddenFor(m => m.YourProperty)将它们存储在隐藏字段中



至于下拉菜单,谷歌如何要在mvc中做下拉列表,那里有很多例子。
If you want your model properties to be kept when the form is submitted then they need to be in a form field. If you don't want them displayed then store them in a hidden field using Html.HiddenFor(m => m.YourProperty)

As for dropdowns, google how to do dropdowns in mvc, there are lots of examples out there.