title: Use Lambda Expression within ASP.NET MVC View using VB.NET
body: <p>With ASP.NET MVC 1.0, .NET 3.5 and C# you can easily pass a method a lambda expression that will do  a "Response.Write" some content when it's executed within the method:</p>
  
  <pre><code>&lt;% Html.SomeExtensionMethod(
      () =&gt; { &lt;%
          &lt;p&gt;Some page content&lt;p&gt;
      %&gt; }
  ) %&gt;
  </code></pre>
  
  <p>The method signature is similar to this:</p>
  
  <pre><code>public void SomeExtensionMethod(this HtmlHelper helper, Action pageContent)
  {
      pageContent();
  }
  </code></pre>
  
  <p>Does anyone know how to peforma a similar call using Lambda expressions in VB.NET using the same method signature shown above?</p>
  
  <p>I've tried the following in VB.NET, but it wont work:</p>
  
  <pre><code>&lt;% Html.SomeExtensionMethod(New Action( _
      Function() %&gt; &lt;p&gt;Some Content&lt;/p&gt; &lt;% _
      )) %&gt;
  </code></pre>
  
  <p>I get an exception saying "Expression Expected."</p>
  
  <p>Can anyone help me with what I'm doing wrong? How do you do this in VB.NET?</p>