日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Ajax.net实现loading登陆的效果

發布時間:2025/4/14 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ajax.net实现loading登陆的效果 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

AjaxPro.dll

一,在aspx的頁面的代碼如下

?

一,在aspx的頁面的代碼如下

?1<%@?Page?Language="C#"?AutoEventWireup="true"?CodeFile="Default5.aspx.cs"?Inherits="ajaxproloading.Default5"?%>
?2
?3<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
?4
?5<html?xmlns="http://www.w3.org/1999/xhtml"?>
?6<head?runat="server">
?7????<title>loaing</title>
?8????<script?language=javascript>
?9????function?Get_Name()
10????{
11??????var?name=document.getElementById("Text1").value;
12??????var?pwd=document.getElementById("Text2").value;
13??????ajaxproloading.Default5.GetLogin(name,pwd,CallBackServer);
14??????document.getElementById("loading").style.display="block";
15?????
16????}

17????function?CallBackServer(res)
18????{
19?????var?success=res.value;
20?????document.getElementById("loading").style.display="none";
21????
22?????if(success)
23?????{
24???????document.getElementById("ss").innerHTML="登陸成功";
25???????
26?????}

27?????else
28?????{
29???????document.getElementById("ss").innerHTML="登陸失敗";
30?????}

31????}

32????
</script>
33</head>
34<body>
35????<form?id="form1"?runat="server">
36????<div>
37????????<input?id="Button1"?type="button"?value="button"?onclick="Get_Name();"?/>
38????????<input?id="Text1"?type="text"?/>
39???????????<input?id="Text2"?type="text"?/></div>
40????????<div?id="loading"?style="display:none;"><img?src=9.gif?/>正在登陸</div>
41???????<div?id="ss"></div>
42????</form>
43</body>
44</html>
45

二,.cs的代碼

?1using?System;
?2using?System.Data;
?3using?System.Configuration;
?4using?System.Collections;
?5using?System.Web;
?6using?System.Web.Security;
?7using?System.Web.UI;
?8using?System.Web.UI.WebControls;
?9using?System.Web.UI.WebControls.WebParts;
10using?System.Web.UI.HtmlControls;
11using?System.Data.SqlClient;
12namespace?ajaxproloading
13{
14????public?partial?class?Default5?:?System.Web.UI.Page
15????{
16????????protected?void?Page_Load(object?sender,?EventArgs?e)
17????????{
18????????????AjaxPro.Utility.RegisterTypeForAjax(typeof(Default5));
19????????}

20????????[AjaxPro.AjaxMethod]
21????????public?bool?GetLogin(string?username,string?userpwd)
22????????{
23????????????System.Threading.Thread.Sleep(3000);
24????????????SqlConnection?con?=?new?SqlConnection("server=.;database=testajax;uid=sa;pwd=lanjie");
25????????????con.Open();
26????????????SqlCommand?com?=?new?SqlCommand();
27????????????com.CommandText?=?"select?*?from?userinfo?where?username='"?+?username?+?"'?and?userpwd='"?+?userpwd+"'";
28????????????com.Connection?=?con;
29????????????SqlDataReader?da?=?com.ExecuteReader();
30????????????if?(da.Read())
31????????????{
32????????????????con.Close();
33????????????????return?true;
34????????????}

35????????????else
36????????????{
37????????????????con.Close();
38????????????????return?false;
39????????????}

40????????}

41????}

42}

43

?

?

平時中 收集的 其他高手的東西來補充自己咯。!!!

【源自】http://www.cnblogs.com/symjie520/archive/2007/04/17/716571.html

轉載于:https://www.cnblogs.com/meiyou/archive/2009/06/01/1493747.html

總結

以上是生活随笔為你收集整理的Ajax.net实现loading登陆的效果的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。