现在的位置: 首页 > 综合 > 正文

mvc3_checkbox数据平铺

2012年11月07日 ⁄ 综合 ⁄ 共 3894字 ⁄ 字号 评论关闭

@model Accentiv.DHL.Entity.CommunicationTemplate
@{
    ViewBag.Title = "添加Email模板";
}
<h1 class="hero-unitbt3">
    添加Email模板</h1>
<p>
    <a href="javascript:void(0);">内容管理</a> - 添加Email模板</p>
<div class="unline">
    &nbsp;</div>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <table class="table table-striped table-bordered displayTable" id="displayTable"
            style="width: 100%">
            <tbody>
                <tr>
                    <td width="19%" class="right">
                        沟通类型
                    </td>
                    <td class="left" width="81%">
                        <div style="float: left; vertical-align: middle; height: 30; width: 20px">
                            <input type="checkbox" style="width: 15px" id="edm" name="cktype" value="edm" />
                        </div>
                        <div style="float: left; vertical-align: middle; height: 30">
                            <label for="edm" style="vertical-align: middle; width: 20px">
                                edm</label>
                        </div>
                        <br />
                        <div style="float: left; vertical-align: middle; height: 30; width: 20px">
                            <input type="checkbox" style="width: 15px" id="sms" name="cktype" value="sms" />
                        </div>
                        <div style="float: left; vertical-align: middle; height: 30">
                            <label for="sms" style="vertical-align: middle; width: 20px">
                                sms</label>
                        </div>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td width="19%" class="right">
                        名称
                    </td>
                    <td class="left" width="81%">
                        @Html.TextBoxFor(model => model.Name, new { @class = "input span3 number" })
                        @Html.ValidationMessageFor(model => model.Name)
                    </td>
                </tr>
                <tr id="trtitle" class="none">
                    <td width="19%" class="right">
                        标题
                    </td>
                    <td class="left" width="81%">
                        @Html.TextBoxFor(model => model.Title, new { @class = "input span3 number" })
                    </td>
                </tr>
                <tr>
                    <td width="19%" class="right">
                        内容
                    </td>
                    <td class="left" width="81%">
                        @Html.TextAreaFor(model => model.Content, 8, 1000, new { @class = "input span8 number" })
                    </td>
                </tr>
                <tr>
                    <td width="19%" class="right">
                        是否是HTML
                    </td>
                    <td class="left" width="81%">
                        @Html.CheckBoxFor(model => model.IsHTML, new { @class = "input span3 number" })
                    </td>
                </tr>
                <tr>
                    <td width="19%" class="right">
                        是否有效
                    </td>
                    <td class="left" width="81%">
                        @Html.CheckBoxFor(n => n.IsValid, new { @class = "input span3 number" })
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="btn_usebox">
            <input class="btn_use" type="submit" id="summbit" value=" 提交" />
        </div>
    </fieldset>
}
<!--搜索结果结束-->
<script type="text/javascript">
    //设置表格隔行变色
    $(document).ready(function () {
        $("table tbody tr:even").addClass("odd");
        $("table tbody tr:odd").addClass("even");
    });

    $(document).ready(function () {
        if ("@ViewBag.Message" != "") {
            alert("@ViewBag.Message");
        }

        $("#edm").change(function () {
            if ($("#edm")[0].checked) {
                $("#trtitle").removeClass("none");
            }
            else {
                $("#trtitle").addClass("none");
            }
        });
    });
</script>
<style>
    .None
    {
        display: none;
    }
</style>

抱歉!评论已关闭.