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