zoukankan      html  css  js  c++  java
  • Asp.net MVC+Bootstrap3的悬浮式登录框效果

    1.引用Bootstarp3

        @Styles.Render("~/Content/css")

        @Scripts.Render("~/bundles/bootstrap")

    2.登陆代码

    @using AquaWeb.Models
    @model LoginViewModel
    @{
        ViewBag.Title = "登录";
    }
    
    
    <div id="loginModal" >
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="text-center text-primary">登录</h1>
                </div>
                <div class="modal-body">
                  
                  @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form col-md-12 center-block", role = "form" }))
                  {
                    @Html.AntiForgeryToken()
                    
                    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    
                        <div class="form-group">
                            
                                @Html.TextBoxFor(m => m.Email, new { @class = "form-control input-lg" ,placeholder = "电子邮件" })
                                @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
                            </div>
                        
                        <div class="form-group">
                            
                                @Html.PasswordFor(m => m.Password, new { @class = "form-control input-lg", placeholder = "登录密码" })
                                @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
                            </div>
                        
                        <div class="form-group">
                            <button class="btn btn-primary btn-lg btn-block">立刻登录</button>
                            <span>@Html.ActionLink("忘记了密码?", "ForgotPassword")</span>
                            <span>@Html.ActionLink("注册新用户", "Register","",new { @class="pull-right"})</span>
                        </div>
                  }
                   
                </div>
                <div class="modal-footer">
    
                </div>
    
            </div>
        </div>
    </div>
    <div>
        <section id="socialLoginForm">
            @Html.Partial("_ExternalLoginsListPartial", new ExternalLoginListViewModel { ReturnUrl = ViewBag.ReturnUrl })
        </section>
    </div>
    
    
    
        @section Scripts {
            @Scripts.Render("~/bundles/jqueryval")
        }
    View Code

    3.注册代码

    @model AquaWeb.Models.RegisterViewModel
    @{
        ViewBag.Title = "注册";
    }
    
    
    <div id="loginModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="text-center text-primary">注册</h1>
                </div>
                <div class="modal-body">
    
                    @using (Html.BeginForm("Register", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form col-md-12 center-block", role = "form" }))
                    {
                        @Html.AntiForgeryToken()
    
                        @Html.ValidationSummary("", new { @class = "text-danger" })
    
                        <div class="form-group">
    
                            @Html.TextBoxFor(m => m.Email, new { @class = "form-control input-lg", placeholder = "电子邮件" })
                            @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
                        </div>
    
                            <div class="form-group">
    
                                @Html.PasswordFor(m => m.Password, new { @class = "form-control input-lg", placeholder = "密码" })
                                @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
                            </div>
    
                            <div class="form-group">
    
                                @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control input-lg", placeholder = "确认密码" })
                                @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
                            </div>
    
                            <div class="form-group">
                                <button class="btn btn-primary btn-lg btn-block">注册</button>
                            </div>
                    }
    
                </div>
                <div class="modal-footer">
    
                </div>
    
            </div>
        </div>
    </div>
    
    @section Scripts {
        @Scripts.Render("~/bundles/jqueryval")
    }
    View Code

    4.界面展示

    5.参考地址:

    http://www.gbtags.com/gb/rtreplayerpreview/183.htm

  • 相关阅读:
    最重要的是动手去做
    java中的native关键字
    用ant重新编译jdk加入调试信息
    UnSupported Encoding错误
    mysql中查看字符集的cmd指令
    java中的IO流读取文件
    分享一个jdk源码链接
    mysql dos启动出现1067错误的解决方法
    vs2010中的外部依赖项的含义
    vs2010中出现:程序管理器匹配不正确错误
  • 原文地址:https://www.cnblogs.com/wangbin5542/p/5673273.html
Copyright © 2011-2022 走看看