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:
<% Html.SomeExtensionMethod(
() => { <%
<p>Some page content<p>
%> }
) %>
The method signature is similar to this:
public void SomeExtensionMethod(this HtmlHelper helper, Action pageContent)
{
pageContent();
}
Does anyone know how to peforma a similar call using Lambda expressions in VB.NET using the same method signature shown above?
I've tried the following in VB.NET, but it wont work:
<% Html.SomeExtensionMethod(New Action( _
Function() %> <p>Some Content</p> <% _
)) %>
I get an exception saying "Expression Expected."
Can anyone help me with what I'm doing wrong? How do you do this in VB.NET?