I am using MVC 3 introduced by WebGrid, but cannot help but apply my own extension methods when passing the delegate to the parameter format.
Using:
Grid.Column("MyProperty", "MyProperty",
format: @<span class="something">@item.MyProperty.MyExtensionMethodForString()</span>)
I got
ERROR: 'string' does not contain a definition for 'MyExtensionMethodForString'
I tried casting, not using
Grid.Column("MyProperty", "MyProperty",
format: @<span class="something">@((string)(item.MyProperty).MyExtensionMethodForString())</span>)
If I use the standard method, it works:
Grid.Column("MyProperty", "MyProperty",
format: @<span class="something">@(Utils.MyExtensionMethodForString(item.MyProperty))</span>)
I also tried putting the extension in the same namespace without any results.
How can I use my favorite extensions?
Edit : a namespace as such is not a problem, a namespace where the extension is available for all views and classes, and I can use it in one view without problems. The problem is using it as a delegate.