高手帮忙啊,为什么我的UpdatePanel不是局部刷新呢 急!!!
aspx文件 //我使用Timer 控件 10秒读取一次更新
<asp:ScriptManager ID= "ScriptManager1 " runat= "server ">
</asp:ScriptManager>
<asp:UpdatePanel ID= "friendlypanel " runat= "server ">
<ContentTemplate>
测试
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID= "getmessagepanel " runat= "server ">
<ContentTemplate>
<%=message_withidarry %>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Timer ID= "returnupdate_withtime " runat= "server " Interval= "10000 " OnTick= "returnupdate_withtime_Tick ">
aspx.cs文件
#region //设置留言更新
protected void returnupdate_withtime_Tick(object sender, EventArgs e)
{
get_getmessage();
}
private void get_getmessage() //获取最新留言
{
read = bll.get_dataset( "select id,sendid from netchat_message where receiveid= " + accountid);
message_withidarry = " ";
for (int i = 0, j = read.Tables[0].Rows.Count; i != j; i++)
{
message_withidarry = message_withidarry + read.Tables[0].Rows[i][ "id "].ToString() + "| ";
}
read = null;
}
#endregion
为什么我不是getmessagepanel的局部更新而还是整个页面的更新呢 请教高手 急!!!
------解决方案--------------------应该把Timer控件放到getmessagepanel的ContentTemplate中
------解决方案--------------------把timer控件放在UpdatePanel 里 试试
<asp:Updat