如何在asp.net,c#中在线创建和显示用户? [英] how to create and display users online in asp.net,c#?

查看:99
本文介绍了如何在asp.net,c#中在线创建和显示用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net,c#中在线创建和显示用户?

how to create and display users online in asp.net,c#?

推荐答案

可帮助您入门的文章夫妇-
ASP.NET中的在线活动用户计数器 [ http://dotnetslackers.com/articles/aspnet/Tracking-User-Activity.aspx [ ^ ]

这是另一个,可以向您显示在线用户列表 [ ^ ].
Couple of articles that should help you get started -
Online active users counter in ASP.NET[^]
http://dotnetslackers.com/articles/aspnet/Tracking-User-Activity.aspx[^]

Here is another one, which can show you the list of users online[^].


创建类似这样的网格,并在文件夹中提供两个绿色和红色按钮
CREATE A GRID LIKE THIS AND GIVE TWO BUTTONS GREEN AND RED IN A FOLDER

img ...................



< asp:gridview id ="dgvUsers" runat ="server" pagesize ="5" width ="158px" autogeneratecolumns ="False" xmlns:asp =#unknown">
DataKeyNames =状态" OnRowDataBound ="dgvUsers_RowDataBound" GridLines =无"
ShowHeader ="False">
<列> < asp:templatefield>
< itemtemplate>
 < asp:image id ="imgGreen" runat ="server" height ="16px" imageurl =〜/Img/green.jpg">
宽度="16px"/>
< asp:image id ="imgRed" runat ="server" height ="16px" imageurl =〜/Img/red.jpg">
宽度="16px"/>

< itemstyle horizo​​ntalalign ="Center">

< asp:boundfield datafield ="USERNAME"标头text ="USERNAME"/>
< asp:boundfield datafield =状态" headertext =状态" visible ="False"/>
< emptydatatemplate>
< asp:image id ="Image1" runat ="server" imageurl =〜/Img/green.jpg"/>




使用计时器将网格与数据库中的数据表绑定.
< asp:timer id ="tmrUser" ontick ="tmrUser_Tick" runat ="server" interval ="30000" xmlns:asp =#unknown">

在计时器滴答事件中调用databind函数.并更改间隔以更改刷新时间...我建议将网格放在更新面板中....

希望这会起作用... !!!!!!!!!!!!!

img...................



<asp:gridview id="dgvUsers" runat="server" pagesize="5" width="158px" autogeneratecolumns="False" xmlns:asp="#unknown">
DataKeyNames="status" OnRowDataBound="dgvUsers_RowDataBound" GridLines="None"
ShowHeader="False">
<columns> <asp:templatefield>
<itemtemplate>
 <asp:image id="imgGreen" runat="server" height="16px" imageurl="~/Img/green.jpg">
Width="16px" />
<asp:image id="imgRed" runat="server" height="16px" imageurl="~/Img/red.jpg">
Width="16px" />

<itemstyle horizontalalign="Center">

<asp:boundfield datafield="USERNAME" headertext="USERNAME" />
<asp:boundfield datafield="Status" headertext="Status" visible="False" />
<emptydatatemplate>
<asp:image id="Image1" runat="server" imageurl="~/Img/green.jpg" />




use a timer to bind the grid with the datatable from the database.
<asp:timer id="tmrUser" ontick="tmrUser_Tick" runat="server" interval="30000" xmlns:asp="#unknown">

call the databind function in timer tick event.. and change the interval to change refresh time...I suggest to put the grid in an update pannel.....

HOPE this will Work...!!!!!!!!!!!!!


Hiiii,

请检查此链接..........
ASP.NET中的在线活动用户计数器 [
Hiiii,

Please check this link..........
Online active users counter in ASP.NET[^]


这篇关于如何在asp.net,c#中在线创建和显示用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆