Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

event delegate communication question
I've got a webapp that uses an event to respond to changes to a
datahub.  I'd like to display the information that comes in with the
event handler to a textbox.  For the event e, just doing textbox.text
= e.message;  returns nothing.  I've managed to get the data by
putting it an application state variable. Then using the page_load
to put it in the textbox.  (a session state variable didn't work.)
The problem with this is it seems to take some sort of control action
such as clicking on a button or other control to make the update
happen.  I suppose what I need is to be able to simulate a button
click.  Any clues?

Thanks,

Robert Megee

Report this thread to moderator Post Follow-up to this message
Old Post
Robert Megee
05-20-05 09:00 AM


Re: event delegate communication question
Still unclear about your problem... some sample code of what exactly
this 'e' is, how is it being used, how is the event-handler being
invoked etc is needed.



Cheers,
Gaurav Vaish
http://mastergaurav.org
http://mastergaurav.blogspot.com
------------------------


Report this thread to moderator Post Follow-up to this message
Old Post
MasterGaurav
05-20-05 01:57 PM


Re: event delegate communication question
Let's see what I can provide.
I use Visual Studio Dotnet 2003.  So far every event that has ever
been coded for my web applications use "e" for the event arguments.
So I just thought that it was a standard.  I'll try to be a bit more
specific.
I've got a socket based datahub that I'm subscribing to for events.

I reference a ddl to do the actual communications.   Here's the code:

public class Webpage : System.Web.UI.Page
{
Using Hume.DMH;

protected System.Web.UI.WebControls.TextBox tb1;

Report this thread to moderator Post Follow-up to this message
Old Post
Robert Megee
05-21-05 08:58 AM


Re: event delegate communication question
tb1.Text = e.message.ToString();

???

"Robert Megee" <rmegee2@comcast.net> wrote in message
 news:op4t81pbnmgd0q807sp145tpbs4frv0g26@
4ax.com...
> Let's see what I can provide.
> I use Visual Studio Dotnet 2003.  So far every event that has ever
> been coded for my web applications use "e" for the event arguments.
> So I just thought that it was a standard.  I'll try to be a bit more
> specific.
> I've got a socket based datahub that I'm subscribing to for events.
>
> I reference a ddl to do the actual communications.   Here's the code:
>
> public class Webpage : System.Web.UI.Page
> {
>      Using Hume.DMH;
>
>      protected System.Web.UI.WebControls.TextBox tb1;
>      .
>      .
>      .
>      static DmhClient dmh = new DmhClient();
>      .
>      .
>      .
>      private void Page_Load(object sender, System.EventArgs e)
>      {
>
>      }
>      .
>      .
>      .
>      private void InitializeComponent()
>      {
>          dmh.Whenmsg += new
>               Hume.DMH.WhenmsgEventHandler(this.dmh_Whenmsg);
>
>      }
>
>
>     private void dmh_Whenmsg(object sender, System.EventArgs e)
>     {
>          tb1.Text = e.message;   //  this doesn't work  even though
>                                                  // in debug it does
>                                                  // process.
>                                                 // nothing shows in
>                                                 // the text box.
>      }
>
> }
>
>
> I can pass the message out of the delegate in an application state
> variable.  Here's what that looks like:
>
>      private void dmh_Whenmsg(object sender, System.EventArgs e)
>      {
>           Application["themessage"] = e.message;
>      }
>
> What I don't under stand is why the first one doesn't work.
>
> Hopefully this explains the problem a bit better.
>
> Robert



Report this thread to moderator Post Follow-up to this message
Old Post
at
05-21-05 01:57 PM


Re: event delegate communication question
e.message is a string so the forced conversion isn't necessary.

Robert
On Sat, 21 May 2005 10:13:01 +0200, "at" <a@t> wrote:

>tb1.Text = e.message.ToString();
>
>???
>
>"Robert Megee" <rmegee2@comcast.net> wrote in message
> news:op4t81pbnmgd0q807sp145tpbs4frv0g26@
4ax.com... 
>


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Megee
05-22-05 01:57 AM


Re: event delegate communication question
EventArgs does not have a Message property.
e.Message should generate a compile time error.


--
Cheers,
Gaurav Vaish
http://mastergaurav.blogspot.com
http://mastergaurav.org
-------------------


Report this thread to moderator Post Follow-up to this message
Old Post
MasterGaurav
05-26-05 01:56 PM


Re: event delegate communication question
Hmmm, but it does pass a value back if I put into an Application state
variable.
>
>EventArgs does not have a Message property.
>e.Message should generate a compile time error.


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Megee
05-27-05 02:00 AM


Re: event delegate communication question
e.message is a string so the forced conversion isn't necessary.

Robert
On Sat, 21 May 2005 10:13:01 +0200, "at" <a@t> wrote:

>tb1.Text = e.message.ToString();
>
>???
>
>"Robert Megee" <rmegee2@comcast.net> wrote in message
> news:op4t81pbnmgd0q807sp145tpbs4frv0g26@
4ax.com... 
>


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Megee
05-27-05 02:00 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

C# archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:00 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.