好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁(yè) > 知識(shí)庫(kù) > 基于Ajax技術(shù)實(shí)現(xiàn)無(wú)刷新用戶(hù)登錄功能

基于Ajax技術(shù)實(shí)現(xiàn)無(wú)刷新用戶(hù)登錄功能

熱門(mén)標(biāo)簽:大眾點(diǎn)評(píng)400電話(huà)怎么申請(qǐng) 東平縣地圖標(biāo)注app 中國(guó)地圖標(biāo)注不明確情況介紹表 立陶宛地圖標(biāo)注 怎樣在地圖標(biāo)注文字 上海企業(yè)外呼系統(tǒng)價(jià)錢(qián) 電銷(xiāo)機(jī)器人 長(zhǎng)春 地圖標(biāo)注推銷(xiāo)坑人 河間市地圖標(biāo)注app

代碼如下:

// JScript 文件
function usersLogon()
{
  var userName = document.getElementById("txtuserName").value;
  var password = document.getElementById("txtpassword").value;
  var checkCode = document.getElementById("txtCheckCode").value;

  var response = userControl_logon.CheckCodeIsRight(checkCode).value;

  if(userName == "")
  {
    document.getElementById("txtuserName").focus();
    return false;
  }
  else if(password == "")
  {
    document.getElementById("txtpassword").focus();
    return false;
  }
  else if(checkCode =="")
  {
    document.getElementById("txtCheckCode").focus();
    return false;
  }
  else
  {
    if(response == true)
    {
      //判斷用戶(hù)是否存在
      userControl_logon.userNameAndPasswordIsExist(userName,password,userNameIsRight);
    }
    else
    {
      alert("驗(yàn)證碼出錯(cuò)");
      userControl_logon.checkCodeOperaotr(refreshCheckCode);
      document.getElementById("txtpassword").value = "";
    }
  }  
}
function userNameIsRight(res)
{
  var userName = document.getElementById("txtuserName").value;
  if(res.value == true)
  {
    //用戶(hù)存在,但要看此用戶(hù)有沒(méi)有進(jìn)入管理留言版權(quán)限,
    userControl_logon.userNameIsRight(userName,CallBack);
  }
  else
  {
    alert("用戶(hù)名或密碼錯(cuò)誤");
    document.getElementById("txtpassword").value = "";
    OnLoad_checkCode();
  }
}
function CallBack(res)
{
  if(res.value == true)
  {
    hideLogon();
    var url = userControl_logon.returnUrl();
    if ( url.value == 404)
    {
      showDefault();
    }
    else
    {
      document.getElementById("Url").innerHTML = 'a href="' + url.value + '">' + url.value + '/a>'
    }
  }
  else
  {
    alert("對(duì)不起你的權(quán)限不夠");
    document.getElementById("txtpassword").value = "";
    OnLoad_checkCode();
  }
}
//隱藏登錄框
function hideLogon()
{
  var element = document.getElementById("hideLogon")
  element.style.display = "none"
  
}
//顯示返回首頁(yè)
function showDefault()
{
  var element = document.getElementById("Returndefault")
  element.style.display = "block" 
}
function OnLoad_checkCode()
{
  userControl_logon.checkCodeOperaotr(refreshCheckCode);
  document.getElementById("txtuserName").focus();
  //  return false;
}
///重新得到新的驗(yàn)證嗎
function refreshCheckCode(res)
{ 
  document.getElementById("txtCheckCode").value = "";
  document.getElementById("lblNumber").innerHTML = res.value;
}
function abce()
{
  alert(document.getElementById("lblNumber").value)
}

下面代碼

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using LHB_SQL_2005;

public partial class userControl_logon : System.Web.UI.UserControl
{
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!this.IsPostBack)
    {
      AjaxPro.Utility.RegisterTypeForAjax(typeof(userControl_logon));
    }
  }

  [AjaxPro.AjaxMethod]
  public static string checkCodeOperaotr()
  {
    string _checkCode = GeneralMethod.GenerateCheckCode();
    System.Web.HttpContext.Current.Session["checkCode"] = _checkCode;
    //返回驗(yàn)證碼
    return _checkCode;
  }

  /// summary>
  /// 判斷驗(yàn)證是否正確
  /// /summary>
  /// param name="checkCode">/param>
  /// returns>/returns>
  [AjaxPro.AjaxMethod]
  public static bool CheckCodeIsRight(string checkCode)
  {
    string _checkCode = (string)(System.Web.HttpContext.Current.Session["checkCode"]); 
    if (_checkCode == checkCode)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  /// summary>
  /// 判斷用戶(hù)名及密碼添加是否正確
  /// /summary>
  /// param name="userName">用戶(hù)名/param>
  /// param name="_password">用戶(hù)名密碼/param>
  /// returns>bool/returns>
  [AjaxPro.AjaxMethod]
  public static bool userNameAndPasswordIsExist(string userName, string _password)
  {
    string password = GeneralMethod.ToEncryptPassword(_password);
    string executeString = "SELECT COUNT(*) FROM users WHERE userName = '" + userName.ToString() + "' AND password = '" + password + "'";
    int count = int.Parse(GetCommand.ExecuteScalar(executeString));
    if (count == 1)
    {
      System.Web.HttpContext.Current.Session["userName"] = userName;
      return true;
    }
    else
    {
      return false;
    }
  }

  /// summary>
  /// 判斷用戶(hù)是不是有這進(jìn)入管理留言版的權(quán)限
  /// /summary>
  /// param name="userName">用戶(hù)名/param>
  /// returns>/returns>
  [AjaxPro.AjaxMethod]
  public static bool userNameIsRight(string userName)
  {
    string executeString = "SELECT [right] FROM role WHERE usersId = (select userNameId from users where userName = '" + userName + "')";
    int count = int.Parse(GetCommand.ExecuteScalar(executeString));
    if (count > 0)
    {
      return true;
    }
    else
    {
      return false;
    }
  }

  /// summary>
  /// 返回Url值
  /// /summary>
  /// returns>/returns>
  [AjaxPro.AjaxMethod]
  public static string returnUrl()
  {
    string url = "";
    try
    {
      url = System.Web.HttpContext.Current.Session["url"].ToString();
    }
    catch
    {
      url ="404";
    }
    return url;
  }
}

下面是頁(yè)面代碼

%@ Control Language="C#" AutoEventWireup="true" CodeFile="logon.ascx.cs" Inherits="userControl_logon" %>
script language="javascript" type="text/javascript" src="../JavaScript/logon.js">
/script>
script language="javascript" type="text/javascript" src="JavaScript/logon.js">
/script>
link href="../CSS/table_css.css" rel="stylesheet" type="text/css" />
link href="CSS/table_css.css" rel="stylesheet" type="text/css" />
body onload="OnLoad_checkCode();">
div>
table border="0" cellpadding="0" cellspacing="0">
    tr>
      td>
        table id="hideLogon" border="0" cellpadding="0" cellspacing="0" style="display:block;">
          tr>
            td style="background-color: #99ccff">用戶(hù)名:/td>
            td>input type="text" id="txtuserName" style="width: 105px" />/td>
          /tr>
          tr>
            td style="background-color: #99ccff">密 碼:/td>
            td>
              input id="txtpassword" type="password" style="width: 105px" />/td>
          /tr>
          tr>
            td style="background-color: #99ccff">驗(yàn)證碼:/td>
            td style="background-color: #99ccff">
              input type= "text" id="txtCheckCode" style=" width:60px" />label id="lblNumber">/label>/td>
          /tr>
          tr>
            td style="background-color: #99ccff">/td>
            td style="background-color: #99ccff">
              input type="button" onclick="usersLogon();" value="登錄" id="btnLogon" />/td>
          /tr>
        /table>
      /td>
    /tr>
    tr>
      td >
        div id="Url">/div>
      /td>
    /tr>
    tr>
      td align="center">
        table id="Returndefault" border="0" cellpadding="0" cellspacing="0" style="display:none;">
          tr>
            td>
              asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">返回首頁(yè)/asp:HyperLink>/td>
          /tr>
        /table>
      /td>
    /tr>
  /table>
/div>
/body>

以上所述是小編給大家介紹的基于Ajax技術(shù)實(shí)現(xiàn)無(wú)刷新用戶(hù)登錄功能,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

您可能感興趣的文章:
  • asp.net+jquery ajax無(wú)刷新登錄的實(shí)現(xiàn)方法
  • 菜鳥(niǎo)蔡之Ajax復(fù)習(xí)第三篇(Ajax之無(wú)刷新登錄)
  • 基于jquery ajax 用戶(hù)無(wú)刷新登錄方法詳解

標(biāo)簽:益陽(yáng) 遼寧 四川 本溪 營(yíng)口 銅川 內(nèi)江 玉樹(shù)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《基于Ajax技術(shù)實(shí)現(xiàn)無(wú)刷新用戶(hù)登錄功能》,本文關(guān)鍵詞  基于,Ajax,技術(shù),實(shí)現(xiàn),無(wú),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《基于Ajax技術(shù)實(shí)現(xiàn)無(wú)刷新用戶(hù)登錄功能》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于基于Ajax技術(shù)實(shí)現(xiàn)無(wú)刷新用戶(hù)登錄功能的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 亚洲欧美一级视频| 性色一区二区三区视频| 99久久综合精品无码| 亚洲综合色婷婷中文字幕| 女人被男人插| 性瘾少妇被粗大爽ⅩXoo网站| 好爽?好紧?我要高潮了app| 99热在线观看精品| ass亚洲熟妇毛茸茸pics| 我要干我要操| 健身教练巨大粗爽Gay视频| 日韩 精品 无码 系列 视频| 国精品无码一区二区三区在线蜜医| 亚洲高清国产品国语在线观看| gogo西西人体大尺度大胆 | 啊轻点灬太粗嗯太深了宝贝q视频| 色综合激情网| 污视频免费软件| 激情qvod经典小说| 国产一级在线观看视频| 日韩中文一区二区| bl一攻多受h嗯啊巨肉寝室np| 我与么公的完整性视频| 和两个男人玩3p好爽mp4| 聚色庄园视频网| 羞羞视频在线网站观看| 欧美护士激情第一欧美精品| 色综合网站国产麻豆| 操女人b视频| 狠狠躁夜夜躁人爽碰人妻视频| 中文字幕精品三| 福利在线一区二区| 亚洲va精品中文字幕动漫| 绑在床头双腿大分h| 国产高清砖码区| 天邦美氣密性檢測儀精度和測量范圍| 1000部啪啪末满18勿入免费| 可以看美女的胸无遮掩的软件| 欧美日本一区二区| 国产韩国精品一区二区三区久久 | 921国产乱码久久久久久|