zoukankan      html  css  js  c++  java
  • MVC3.0 提交表单的方法

    在views中使用 @using (Html.BeginForm()) 来完成,其中放一个submit类型的提交按钮,如:

    @using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
    <legend>人员信息</legend>

    @Html.HiddenFor(model => model.ID)

    <div class="editor-label">
    @Html.LabelFor(model => model.Code,"编号")
    </div>
    <div class="editor-field">
    @Html.EditorFor(model => model.Code)
    @Html.ValidationMessageFor(model => model.Code)
    </div>

    <div class="editor-label">
    @Html.LabelFor(model => model.Name,"姓名")
    </div>
    <div class="editor-field">
    @Html.EditorFor(model => model.Name)
    @Html.ValidationMessageFor(model => model.Name)
    </div>
    <div class="editor-label">
    @Html.LabelFor(model => model.RoleName,"角色")
    </div>
    <div class="editor-field">
    @Html.DropDownList("RoleName")
    @Html.ValidationMessageFor(model => model.RoleName)
    </div>

    @Html.HiddenFor(model => model.Password)

    <div class="editor-label">
    @Html.LabelFor(model => model.Remark,"备注")
    </div>
    <div class="editor-field">
    @Html.EditorFor(model => model.Remark)
    @Html.ValidationMessageFor(model => model.Remark)
    </div>

    <p>
    <input type="submit" value="保存" />
    </p>
    </fieldset>
    }
  • 相关阅读:
    java注解
    Mac窗口管理管理软件SizeUp
    mac下8080端口到80端口的转发
    mac svn的替代品CornerStone
    模板模式讲解二
    数组和集合List的相互转化
    fastjson使用示例
    模板模式讲解一
    mybatis-generator-core自动生成do、mapping、dao 代码
    maven依赖传递关系
  • 原文地址:https://www.cnblogs.com/muxueyuan/p/3929572.html
Copyright © 2011-2022 走看看