溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

MVC+EasyUI+三層新聞網(wǎng)站如何搭建后臺(tái)登錄界面

發(fā)布時(shí)間:2021-07-13 14:23:06 來(lái)源:億速云 閱讀:150 作者:小新 欄目:開(kāi)發(fā)技術(shù)

小編給大家分享一下MVC+EasyUI+三層新聞網(wǎng)站如何搭建后臺(tái)登錄界面,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

新聞網(wǎng)站建立,后臺(tái)登錄界面的搭建

首先我們?cè)贑ontrollers里面新添加一個(gè)控制器就叫LoginController,右鍵點(diǎn)擊Controllers添加控制器就可以了(注意后面一定是Controller結(jié)尾,這是一種約定)

MVC+EasyUI+三層新聞網(wǎng)站如何搭建后臺(tái)登錄界面

其次:右鍵點(diǎn)擊index建立Index視圖。(不選擇使用母版頁(yè))

MVC+EasyUI+三層新聞網(wǎng)站如何搭建后臺(tái)登錄界面

現(xiàn)在我們就可以在Index視圖中設(shè)計(jì)我們的登錄頁(yè)面了。

這里需要我們引入幾個(gè)Css樣式和JS文件

MVC+EasyUI+三層新聞網(wǎng)站如何搭建后臺(tái)登錄界面

簡(jiǎn)單的進(jìn)行登錄界面的布局

<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="external nofollow" rel="stylesheet" />
 <link href="~/Content/EasyUI/themes/icon.css" rel="external nofollow" 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 ></div>
   <table>
    <tr>
     <td ></td>
     <td>用戶名:</td>
     <td><input type="text"class="easyui-textbox" id="txtName" name="txtName"/></td>
     <td><span id="spanName" ></span></td>
    </tr>
    <tr ></tr>

    <tr>
     <td ></td>
     <td>密 碼:</td>
     <td><input type="password/"class="easyui-textbox"id="txtPwd" name="txtPwd"></td>
     <td><span id="spanPwd" ></span></td>
    </tr>
    <tr ></tr>
    <tr>
     <td ></td>
     <td>驗(yàn)證碼:</td>
     <td><input type="text"class="easyui-textbox" id="txtVcode" name="txtVcode"/></td>
     <td><span id="spanVcode"></span></td>
    </tr>

    <tr ></tr>

    <tr>
     <td ></td>
     <td><img id="image" src=""  /></td>
     <td><a href="javascript:void(0)" rel="external nofollow" rel="external nofollow" id="changeVcode">看不清,換一張</a></td>
    </tr>
    
   </table>
  </div>
  <div ></div>
  <div data-options="region:'south',border:false" >
   <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" rel="external nofollow" rel="external nofollow" id="btnOk" >登錄</a>
  </div>
  </div>
</body>
</html>

運(yùn)行的結(jié)果圖:

MVC+EasyUI+三層新聞網(wǎng)站如何搭建后臺(tái)登錄界面

這里驗(yàn)證碼的圖片沒(méi)有顯示出來(lái),這是沒(méi)有關(guān)系的,在下一節(jié)中就講怎么把驗(yàn)證碼顯示出來(lái)。

看完了這篇文章,相信你對(duì)“MVC+EasyUI+三層新聞網(wǎng)站如何搭建后臺(tái)登錄界面”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI