Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageStill 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 ------------------------
Post Follow-up to this messageLet'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;
Post Follow-up to this messagetb1.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
Post Follow-up to this messagee.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... >
Post Follow-up to this messageEventArgs does not have a Message property. e.Message should generate a compile time error. -- Cheers, Gaurav Vaish http://mastergaurav.blogspot.com http://mastergaurav.org -------------------
Post Follow-up to this messageHmmm, 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.
Post Follow-up to this messagee.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... >
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.