@model string
<div class="main">
    <form class="form-horizontal form form-group-sm ui-validForm" action="@Url.Action()" method="post" id="_form">

        @{
            string beforeSubmitJs = "";
            var data = new ViewDataDictionary();
            data.Add("from", "admin");
            data.Add("table", ViewBag.Table); //对应的表
            data.Add("detailId", ViewBag.DetailId); //当前信息id
            data.Add("siteId", ViewBag.SiteId);  //当前站点id
            data.Add("guid", ViewBag.Guid);
            data.Add("currentUser", ViewBag.CurrentUser);
            data.Add("i", 0);
            IEnumerable<dynamic> FieldData = ViewBag.FieldData;
            int i = 0;
            if (FieldData != null)
            {
                foreach (var row in FieldData)
                {
                    data["i"] = i;
                    beforeSubmitJs += row.before_submit_js;
                    Html.RenderPartial("~/Views/CustomForm/FormPartial.cshtml", (object)row, data);
                    i++;
                }
            }

        }
        <script type="text/javascript">
                        function BeforeSubmit() {
                            @beforeSubmitJs
                            return true;
                        }
        </script>

        @*<div class="control-group">
                <label class="control-label" for="xuhao">序号</label>
                <div class="controls">
                    <input type="text" name="xuhao" id="xuhao" maxlength="3" value="1" class="form-control form-control-xs" data-validate="dataType:'num">
                    <span class="help-block"></span>
                </div>
            </div>*@
        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls form-inline">
                <input type="hidden" id="guid" name="guid" value="@ViewBag.Guid" />
                <input type="hidden" id="id" name="id" />
                <input type="hidden" id="table" name="table" />
                <input type="hidden" id="detail_id" name="detail_id" />
                <input type="hidden" id="uid" name="uid" />
                <input type="hidden" id="username" name="username" />
                <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action()',callBack:'PostRefreshBack'" id="bt_submit">提交</button>
                <button type="button" class="btn btn-default btn-sm ui-closeDialog">关闭</button>
                <span class="help-block"></span>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    InitTab();
    //绑定数据
    var id = Request("id");
    if (id != "") {
        var model =@Html.Raw(Model??"null");
        $("#_form").FormBind(model)
    }
</script>