Hi,
I can't run Javascript from codebehind in my component.
My compenent simply listen a server from TCP/IP socket and create a nre thread for listening.
this.tcpClnt = new TcpClient();
this.tcpClnt.Connect(this.HostIP, Conversions.ToInteger(this.HostPort));
this.Stm = this.tcpClnt.GetStream();
new Thread(new ThreadStart(this.ReadSocket)).Start();
In my component ChangeState event, I'm trying to update a label.text.
protected void My_ChangeState(string state)
{
string message = "<script language='javascript'>document.getElementById("pnl_myLabel").innerText = 'test';</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "message", message);
}
I tried with RegisterClientScriptBlock but it didn't change the label text.
I guess it is because of there are running in different threads.
...
Go to the complete details ...