Advertisement

06.14.2007 at 11:29AM PDT, ID: 22634685
[x]
Attachment Details

Raising Event  C# .net 2.0 : Event handler object show null value

Asked by apeter in Microsoft Visual C#.Net, .NET Framework 2.0

Tags: event

Hi,
    I have Windows forms(UI Component) which has a lable and the message for the label from  my bussiness component. I'm trying to do this by raising a Event with Data which will be captured in UI. Is this possible ? Below is the code which i have in business component.

namespace ...below classes are in one .cs file
{
public class UpdateEventArgs : EventArgs
{
        public string msg;
 }
public delegate void UpdateEventHandler(object sender, UpdateEventArgs e);
public class test
{
       ......
       public event UpdateEventHandler Update;
       UpdateEventArgs evegrs = new UpdateEventArgs();
       protected virtual void onUpdate(UpdateEventArgs e)
        {
            if (update != null)  //"update" is showing as Null , please tell me what am i missing
                update(this, e);
        }
       
        public void SomeBussiness() //method called from UI Layer
        {
            evegrs.msg= "Hello World";
            onUpdate(evegrs);            
        }
}

I'm working on .net 2.0, on a windows 2003 server.

Thanks
-AaronStart Free Trial
 
Loading Advertisement...
 
[+][-]06.14.2007 at 12:43PM PDT, ID: 19286422

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.14.2007 at 07:52PM PDT, ID: 19288898

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.14.2007 at 09:24PM PDT, ID: 19289197

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.14.2007 at 10:04PM PDT, ID: 19289335

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.14.2007 at 11:06PM PDT, ID: 19289529

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.15.2007 at 12:11AM PDT, ID: 19289724

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.15.2007 at 05:46AM PDT, ID: 19291265

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.15.2007 at 06:06AM PDT, ID: 19291416

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.15.2007 at 08:02AM PDT, ID: 19292454

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.15.2007 at 08:25AM PDT, ID: 19292675

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, .NET Framework 2.0
Tags: event
Sign Up Now!
Solution Provided By: snehanshu
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.16.2007 at 10:52AM PDT, ID: 19298871

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.18.2007 at 05:35AM PDT, ID: 19306389

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32