Archive for the ‘Code Snippet’ Category
<%@ Page directive and language
Compilation Error
Compiler Error Message: BC32017: Comma, ‘)’, or a valid expression continuation expected.
<% Response.Write(”
Turns out if you dont declare the page language in the <%@ Page directive, it will default to a VB page and try to compile it that way.
ForEach for IEnumerable
My Technobabble : ForEach, a simple but very useful extension method
This evening I was writing some code (Yay!) for an Xml based MEF catalog I am prototyping. I came across the need to invoke a set of methods on an IEnumerablethat was returned from a LINQ to XML query. Unfortunately no such animal exists on IEnumerable.
This came in very useful, thanks Glenn – basically, I needed a ForEach to handle some lamda’s, on a Stack<T>, and this was very useful!