Enter your email address:


feedburner count

C# 2.0 : Anonymous Methods

Labels:

What is Anonymous Method ?
C# 2.0 introduce new method named Anonymous Methods. Anonymous Methods are Inline Delegate.

Old school Delegate :

this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
void btnLogin_Click(object sender, System.EventArgs e)
{
Response.Write(
"tui ne");
}


Anonymous Method :

this.btnLogin.Click += delegate { Response.Write("tui ne"); }




blog comments powered by Disqus