C# 2.0 : Anonymous Methods
Posted by
hungle
Labels:
Dot Net
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
Subscribe to:
Post Comments (Atom)