MVC+EasyUI+三層新聞網站建立(二後台登入介面的搭建)

來源:互聯網
上載者:User

標籤:ini   color   mod   change   script   body   pts   pass   options   

首先我們在Controllers裡面新添加一個控制器就叫LoginController,右鍵點擊Controllers添加控制器就可以了(注意後面一定是Controller結尾,這是一種約定)

其次:右鍵點擊index建立Index視圖。(不選擇使用主版頁面)

 

現在我們就可以在Index視圖中設計我們的登入頁面了。

這裡需要我們引入幾個Css樣式和JS檔案

簡單的進行登入介面的布局

<html><head>    <meta name="viewport" content="width=device-width" />    <title>登入</title>    <script src="~/Scripts/jquery-1.8.2.js"></script>    <script src="~/Content/EasyUI/jquery.easyui.min.js"></script>    <script src="~/Content/EasyUI/easyui-lang-zh_CN.js"></script>    <link href="~/Content/EasyUI/themes/default/easyui.css" rel="stylesheet" />    <link href="~/Content/EasyUI/themes/icon.css" rel="stylesheet" />    <script type="text/javascript">        $(function () {            initWin();  //初始化登入表單        });        function initWin() {            $("#win").window({                title: "登入",                width: 400,                height: 270,                collapsible: false,                minimizable: false,                maximizable: false,                closable: false,                modal: true,                resizable: false,            });        }    </script></head><body>    <div id="win"class="easyui-window">        <div>            <div style="height:20px"></div>            <table>                <tr>                    <td style="width:20px"></td>                    <td>使用者名稱:</td>                    <td><input type="text"class="easyui-textbox" id="txtName" name="txtName"/></td>                    <td><span id="spanName" style="color:red"></span></td>                </tr>                <tr style="height:10px"></tr>                <tr>                    <td style="width:20px"></td>                    <td>密  碼:</td>                    <td><input type="password/"class="easyui-textbox"id="txtPwd" name="txtPwd"></td>                    <td><span id="spanPwd" style="color:red"></span></td>                </tr>                <tr style="height:10px"></tr>                <tr>                    <td style="width:20px"></td>                    <td>驗證碼:</td>                    <td><input type="text"class="easyui-textbox" id="txtVcode" name="txtVcode"/></td>                    <td><span id="spanVcode"style="color:red"></span></td>                </tr>                <tr style="height:10px"></tr>                <tr>                    <td style="width:20px"></td>                    <td><img id="image" src="" style="float: left; height: 24px;" /></td>                    <td><a href="javascript:void(0)" onclick="changeCheckCode();return false;">看不清,換一張</a></td>                </tr>                            </table>        </div>        <div style="height:10px"></div>        <div data-options="region:‘south‘,border:false" style="text-align:center;padding:5px 0 0;">            <a class="easyui-linkbutton" data-options="iconCls:‘icon-ok‘" href="javascript:void(0)" id="btnOk" style="width:80px">登入</a>        </div>        </div></body></html>

啟動並執行結果圖:

這裡驗證碼的圖片沒有顯示出來,這是沒有關係的,在下一節中就講怎麼把驗證碼顯示出來。

MVC+EasyUI+三層新聞網站建立(二後台登入介面的搭建)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.