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.Configur ation;
using System.Collecti ons;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
// reference of COM Component
using AgentController Lib;
public partial class RunTestCase_Sam ple : System.Web.UI.P age
{
// creating Object of COM Component
AgentController CompClass objAgent = new AgentController CompClass();
protected void Page_Load(objec t sender, EventArgs e)
{
// creating delegate for asynchronous event
objAgent.SendCa llBack2Client += new
_IAgentControll erCompEvents_Se ndCallBack2Clie ntEventHandler( objAgent_SendCa llBack2Client);
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_SendCa llBack2Client(s tring Result)
{
// getting value in Result variable and showing it on
TextBoxShowResu lt
TextBoxShowResu lt.Text += Result;
}
}
Now here when I am assigning Result to TextBoxShowResu lt, it is not
reflecting on web page.
The reason may be the creation of secondary thread while calling of the
function objAgent_SendCa llBack2Client.
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
Masudur wrote:
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
On Dec 26, 10:24 am, "pallaw" <pallaw...@yaho o.comwrote:
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