Here is the code which defines a C# EventHandler, as written in the documentation, it represents the method that will handle an event that has no event data:

// Summary:
//     Represents the method that will handle an event that has no event data.
//
// Parameters:
//   sender:
//     The source of the event.
//
//   e:
//     An System.EventArgs that contains no event data.
[Serializable]
[ComVisible(true)]
public delegate void EventHandler(object sender, EventArgs e);

So after declaring a specific event:

private event EventHandler OnSomethingHappened;

We need to write a method to raise this event:


Continue Reading...

Here is a short tutorial about how to track Any Link Click with Google Analytics.

The first thing you will have to do is add a short snippet of code to the link you want to track. The code snippet you are adding is actually an OnClick JavaScript event handler that will be executed when the link is clicked and make Google Analytics take note of it. What you have to add is this the following:


Continue Reading...

I’ve read about jQuery in this great post Five recommendations for starting a startup with ASP.NET and wanted to play with it and see how easy it is to call a WebMethod from sQuery. I Started by reading some of the great Tutorials and downloaded the code from here. I Created a test web project, […]


Continue Reading...

We all know the pattern to declare an event in C#, fairly easy, here is a remainder: 1: public class EventTest 2: { 3: public event EventHandler MyEvent; 4:  5: public void RaiseEvent() 6: { 7: if(MyEvent != null) 8: { 9: MyEvent(this, EventArgs.Empty); 10: } 11: } 12: } I know that many people […]


Continue Reading...

Although the .NET Framework takes the memory management task out of your hands, there are still a few things that you must pay attention to when disposing of an object in order for the Garbage Collector to do its work properly. You would think that once you remove the reference from an object it will […]


Continue Reading...