473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How web control can be updated via child thread.

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

Dec 26 '06 #1
2 1191
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...@yahoo.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
Dec 26 '06 #2
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_SendCallBack2ClientEve ntHandler(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


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...@yahoo.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
Dec 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
5
by: Barry Carr | last post by:
Hi, I've created a composite custom web control and a ControlDesigner descendant to render the control a design time. The child controls are public properties of composite control and as such...
3
by: Vinicius Bellino | last post by:
Hi All, Is there a way to change a property of an UI control, such as the enabled property of a button, in a child thread? I mean, my code runs a long process, and because I wanted to show the...
2
by: David Ricker | last post by:
I have created a PictureBox control which can have it's Image property directly bound to an image field in a database. This works perfectly for showing the images that are in the database. When I...
10
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a...
2
by: Kiran | last post by:
Hello all, I am using a tree to display stuff, and it is constantly updated, but what I have noticed is in the lowest level, there is clearly noticable cutoff of the text I place there. The cutoff...
5
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
5
by: Peted | last post by:
Just some threading questions 1. in a MDI app if you have multiple child forms, does each child form run in its own thread ? Eg do you get error trying to update one control on form1 from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.