2011-07-31 57 views
0

我似乎无法让我的updatepanel正确更新。有时它会在UpdatePanel1.Update()时更新,有时它不会。我真的很感谢一些帮助。UpdatePanel没有更新

internal SourceRcon rcon; 
    protected void Page_Load(object sender, EventArgs e) 
    { 
     rcon = new SourceRcon(); 
     IPEndPoint point = new IPEndPoint(IPAddress.Parse("192.168.1.120"), 27015); 
     rcon.ConnectionSuccess += new BoolInfo(rcon_ConnectionSuccess); 
     rcon.Connect(point, "password"); 
    } 

    void rcon_ConnectionSuccess(bool info) 
    { 
     if (info) 
     { 
      rcon.ServerOutput += new StringOutput(rcon_ServerOutput); 
      rcon.ServerCommand("status"); 
     } 
    } 

    void rcon_ServerOutput(string output) 
    { 
     UpdatePanelText.Text = output; 
     UpdatePanel1.Update(); 
    } 

回答

0

从我的经验 - 如果在UP没有改变,那么它不会更新。我的意思是,如果“输出”是行动后的山姆,UpdatePanel不会改变。

+0

“输出”字符串始终更改。但是,大约90%的时间内,updatepanel中的标签将仅显示默认文本或“标签”。 –

+0

然后进行实验并在Firefox中运行该页面并查看“net”选项卡。寻找被中止的请求 - 这可能会有所帮助。 – IamDeveloper

+0

我没有看到任何中止的请求...只是“301永久移动”和“302暂时移动”。 –