bootstrap 模态窗口实例

48 篇文章 1 订阅
46 篇文章 0 订阅
@ModelType IEnumerable(Of MVCTEST.TestTable)


@Code
    Layout = Nothing
End Code


<!DOCTYPE html>


<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>


    @*<link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">*@
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    @*<script src="/scripts/jquery.min.js"></script>*@
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    @*<script src="/bootstrap/js/bootstrap.min.js"></script>*@
    <script src="~/Scripts/bootstrap.min.js"></script>


</head>
<body>
    <!-- 提示框 --> 
    <div id="myAlert" class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert"
                aria-hidden="true">
            &times;
        </button>
        错误!请进行一些更改。
    </div>
    <!-- 提示框被关闭后触发方法 -->
    <script type="text/javascript">
        //$(function () {
        //    $("#myAlert").bind('closed.bs.alert', function () {
        //        alert("警告消息框被关闭。");
        //    });
        //    $("#myAlert").visible = false;
        //});


        $(function () {
            $('#mydelete').click(function () {
                alert("要变更吗?");
                $("#myAlert").visible = false;
            });
        });


    </script> 


    <p>
        @Html.ActionLink("新  規", "Create")
    </p>


    <!-- 按钮触发模态框 -->
    <button class="btn btn-primary btn-lg" data-toggle="modal"
            data-target="#myModal">
        开始演示模态框
    </button>
    
    <!-- 提示框被关闭后触发方法 -->
    <script type="text/javascript">
        function aa()
        {
            alert("点击提交更改按钮啦");
           
            $.ajax({
                type: "POST",
                url: "http://localhost:57698/TestTables/aaa",
                data: "id=3",// + $("#text1").val(),
                //success: function () {
                //    alert("添加成功!");
                //}
            });


            $('#myModal').modal('hide')
        }
    </script>  
    




    <!-- 模态框(Modal) -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        模态框(Modal)标题
                    </h4>
                </div>
                <div class="modal-body">
                    在这里添加一些文本
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" id="submitbtn" class="btn btn-primary" οnclick="aa()" >
                        提交更改
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>


    <table class="table">
        <tr>
            <th>
                @*@Html.DisplayNameFor(Function(model) model.itemName)*@
                @Html.DisplayName("項目名")
            </th>
            <th>
                @*@Html.DisplayNameFor(Function(model) model.itemStr)*@
                @Html.DisplayName("項目内容")
            </th>
            <th>
                @*@Html.DisplayNameFor(Function(model) model.itemDec)*@
                @Html.DisplayName("小数項目")
            </th>
            <th>
                @*@Html.DisplayNameFor(Function(model) model.itemInt)*@
                @Html.DisplayName("整数項目")
            </th>
            <th>
                @*@Html.DisplayNameFor(Function(model) model.itemFlg)*@
                @Html.DisplayName("RadioButtonフラグ")
            </th>
            <th>
                @Html.DisplayName("日付")
            </th>
            <th>
                @Html.DisplayName("操  作")
            </th>
        </tr>
    
    @For Each item In Model
        @<tr>
            <td>
                @Html.DisplayFor(Function(modelItem) item.itemName)
            </td>
            <td>
                @Html.DisplayFor(Function(modelItem) item.itemStr)
            </td>
            <td>
                @Html.DisplayFor(Function(modelItem) item.itemDec)
            </td>
            <td>
                @Html.DisplayFor(Function(modelItem) item.itemInt)
            </td>
            <td>
                @Html.DisplayFor(Function(modelItem) item.itemFlg)
            </td>
            <td>
                @Html.DisplayFor(Function(modelItem) item.itemDateTime)
            </td>
            <td>
                @*οnclick="return confirm('alert('确定要删除吗?')"*@
                @Html.ActionLink("変更", "Edit", New With {.id = item.id, .itemFlg = item.itemFlg}) |


              @Html.ActionLink("詳細", "Details", New With {.id = item.id}) |
                @Html.ActionLink("削除", "Delete", New With {.id = item.id}, New With {.id = "mydelete"})
            </td>
        </tr>
    Next
    
    </table>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值