做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

ajax 數(shù)據(jù)庫(kù)中隨機(jī)讀取5條數(shù)據(jù)動(dòng)態(tài)在頁(yè)面中刷新

來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 22:52:35
文檔

ajax 數(shù)據(jù)庫(kù)中隨機(jī)讀取5條數(shù)據(jù)動(dòng)態(tài)在頁(yè)面中刷新

ajax 數(shù)據(jù)庫(kù)中隨機(jī)讀取5條數(shù)據(jù)動(dòng)態(tài)在頁(yè)面中刷新:不能用數(shù)據(jù)庫(kù)中的Top,后面發(fā)現(xiàn)了用這樣一個(gè)方法可以實(shí)現(xiàn)。現(xiàn)就這個(gè)方法總結(jié)寫了一個(gè)頁(yè)面。有興趣的朋友們可以一起學(xué)習(xí)下。 前臺(tái)代碼: 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=ajaxRando
推薦度:
導(dǎo)讀ajax 數(shù)據(jù)庫(kù)中隨機(jī)讀取5條數(shù)據(jù)動(dòng)態(tài)在頁(yè)面中刷新:不能用數(shù)據(jù)庫(kù)中的Top,后面發(fā)現(xiàn)了用這樣一個(gè)方法可以實(shí)現(xiàn)。現(xiàn)就這個(gè)方法總結(jié)寫了一個(gè)頁(yè)面。有興趣的朋友們可以一起學(xué)習(xí)下。 前臺(tái)代碼: 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=ajaxRando

不能用數(shù)據(jù)庫(kù)中的Top,后面發(fā)現(xiàn)了用這樣一個(gè)方法可以實(shí)現(xiàn)。。現(xiàn)就這個(gè)方法總結(jié)寫了一個(gè)頁(yè)面。有興趣的朋友們可以一起學(xué)習(xí)下。。
前臺(tái)代碼: 
代碼如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ajaxRandomData.aspx.cs" Inherits="ajaxRandomData" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ajax隨機(jī)生成數(shù)據(jù)</title>
<script language="javascript" type="text/javascript" src="ajax/jquery.js"></script>
<script >
//頁(yè)面的初始化
$(document).ready(function(){randomData()});
//頁(yè)面初始化函數(shù)
function randomData()
{
$.ajax({
type:'POST',
url:'ajaxRandomData.aspx',
data:{action:'randon'},
success:randomDatacallbace
});
}
// 頁(yè)面初始化回調(diào)函數(shù)
function randomDatacallbace(data)
{
if(data=="")
{
alert("暫時(shí)不能為您生成數(shù)據(jù)");
$("#randomData").html("暫時(shí)不能為您生成數(shù)據(jù)");
}
else
{
$("#randomData").html(data);
randomtime();//每隔5秒鐘執(zhí)行一次
}
}
//動(dòng)態(tài)變化頁(yè)面中顯示的數(shù)據(jù)。
function randomtime()
{
setTimeout(function(){randomData()},2000)
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align:center" id="randomData">
</div>
</form>
</body>
</html>

后臺(tái)代碼:
代碼如下:
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.Data.SqlClient;
using System.Text;
public partial class ajaxRandomData : System.Web.UI.Page
{
string StrAction = "";
protected void Page_Load(object sender, EventArgs e)
{
StrAction=Request["action"];
if(StrAction=="randon")
{
InitData();
}
}
/// <summary>
///創(chuàng)建人:周昕
/// 創(chuàng)建時(shí)間:2009-6-9
/// 方法名稱:InitData
/// 方法作用:動(dòng)態(tài)的生成表格并隨機(jī)的生成5條數(shù)據(jù)
/// </summary>
public void InitData()
{
SqlConnection mycon = new SqlConnection();
mycon.ConnectionString = ConfigurationManager.ConnectionStrings["BoBoConn"].ToString();
//隨機(jī)生成數(shù)據(jù)的關(guān)鍵
string sql = "select top 5 *,newid() from loginuser order by newid()";
SqlDataAdapter myda = new SqlDataAdapter(sql, mycon);
DataSet myset = new DataSet();
myda.Fill(myset);
DataTable mytable = myset.Tables[0];
int n = mytable.Rows.Count;
StringBuilder str = new StringBuilder();
str.Append("<table style='text-align:left;color:red;width:600px'><tr style='color:#00FF00;font-size:40px;text-align:center'><td colspan='3'>動(dòng)態(tài)刷新用戶信息</td></tr><tr style='color:#6600FF'><td style='text-align:left;width:100px'>用戶名</td><td style='text-align:left;width:200px'>用戶全名</td><td style='width:250px'>電子油箱</td></tr>");
for (int i = 0; i < n; i++)
{
string username = mytable.Rows[i]["username"].ToString();
string fullname = mytable.Rows[i]["FullName"].ToString();
string email = mytable.Rows[i]["Email"].ToString();
if (i % 2 != 0)
{
str.Append("<tr><td>" + username + "</td>");
str.Append("<td>" + fullname + "</td>");
str.Append("<td>" + email + "</td></tr>");
}
else
{
str.Append("<tr style='color:blue'><td>" + username + "</td>");
str.Append("<td>" + fullname + "</td>");
str.Append("<td>" + email + "</td></tr>");
}
}
str.Append("</table>");
Response.Clear();
Response.ContentType = "application/text";
Response.Write(str);
Response.End();
}
}

效果圖

聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

ajax 數(shù)據(jù)庫(kù)中隨機(jī)讀取5條數(shù)據(jù)動(dòng)態(tài)在頁(yè)面中刷新

ajax 數(shù)據(jù)庫(kù)中隨機(jī)讀取5條數(shù)據(jù)動(dòng)態(tài)在頁(yè)面中刷新:不能用數(shù)據(jù)庫(kù)中的Top,后面發(fā)現(xiàn)了用這樣一個(gè)方法可以實(shí)現(xiàn)。現(xiàn)就這個(gè)方法總結(jié)寫了一個(gè)頁(yè)面。有興趣的朋友們可以一起學(xué)習(xí)下。 前臺(tái)代碼: 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=ajaxRando
推薦度:
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 固始县| 游戏| 德安县| 永新县| 桦川县| 凌云县| 安庆市| 道孚县| 云浮市| 越西县| 临湘市| 中西区| 克什克腾旗| 海原县| 金山区| 五河县| 江孜县| 日喀则市| 通许县| 永丰县| 凤城市| 建昌县| 五河县| 东阳市| 南涧| 沙坪坝区| 乌鲁木齐县| 沿河| 桐城市| 大兴区| 嘉义县| 维西| 通山县| 平邑县| 钟祥市| 屏东市| 军事| 岗巴县| 铜山县| 灵石县| 托里县|