您的位置:首页 > 其它

基于Ajax:实时刷新数据,实时显示状态,局部刷新的示例。

2007-04-11 15:26 741 查看
aspx页面:

_Default为类名称,GetServiceStatus为类中的一个方法。

<!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>Untitled Page</title>
</head>
<body onload="setInterval('SetMessage()',100);">
<form id="form1" runat="server">
<table>
<tr><td width="250"><div id="lblStatus"></div></td><td>
<div id="btnPanel" style="visibility:visible"><asp:Button ID="btnSet" runat="server" Text="Button" OnClick="btnSet_Click1" /></div></td></tr>
</table>
</form>
</body>
</html>

.cs文件


protected void Page_Load(object sender, EventArgs e)

[Ajax.AjaxMethod()]
public string GetServiceStatus()
{
return ctl.Status.ToString();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: