How web control can be updated via child thread.

  • Thread starter Thread starter pallaw
  • Start date Start date
P

pallaw

Hello All,
My web Client is using a COM component with connection point enabled.my
client is getting call back from this component.now I have to update a
text control in handler of this callback.but my control is not
updating.can any body tell me how can i update textbox when i get a
thread event .

Thanks & Regards
Pallaw
 
Hi...

I am not sure about the exact senario...
But you can not push any thing to your client...
rather you have to pull....
that is after the call back event... save the desire stuff in
session....
and put a javascript timer in your asp.net application.... and submit
the page after some time...
and in postback do update the stuff that you require.....
Hope this will work....

Thanks

Masudur
kaz Software Ltd.
www.kaz.com.bd
 
Hi ,

Thanx Masudur for your reply.
It will be helpful if you can send me an example code.
Let me make my question more clear.

I have written a C# 2.0 web application which is getting Asynchronous
messages from a call back (This CallBack is an event exposed by a COM
component). To handle this callback event, I have created a delegate.
In Event handler of that delegate

I am receiving a message from call back and I want to show that message
on Text box on Web page as soon as I get message from call back event.
For Your reference I am giving you some code snippets here:

// Code snippet

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


// reference of COM Component
using AgentControllerLib;

public partial class RunTestCase_Sample : System.Web.UI.Page
{
// creating Object of COM Component
AgentControllerCompClass objAgent = new AgentControllerCompClass();
protected void Page_Load(object sender, EventArgs e)
{
// creating delegate for asynchronous event
objAgent.SendCallBack2Client += new
_IAgentControllerCompEvents_SendCallBack2ClientEventHandler(objAgent_SendCallBack2Client);


string testCases ="C:/TestCases/MMF_TC1";
//passing testcases to SendTC Method
objAgent.SendTC(testCases);
}



// this is call back event handler
// this call back occurs asynchronously once it returns result
value .
void objAgent_SendCallBack2Client(string Result)
{
// getting value in Result variable and showing it on
TextBoxShowResult
TextBoxShowResult.Text += Result;
}
}

Now here when I am assigning Result to TextBoxShowResult, it is not
reflecting on web page.

The reason may be the creation of secondary thread while calling of the
function objAgent_SendCallBack2Client.

I searched the solution for this problem in the forums and I found that
AJAX may help me out from this problem .

I am novice to this AJAX technology so any help will be appreciated.

Regards,

Pallaw
 
Back
Top