asp.net - How to use extensions and utility methods in markup? -
Okay maybe this is actually a stupid question, but I'm going to ask it in any way ... < / P>
How can I use extensions and utility methods in my ASP.NET markup? For example, (say) I have a date time extension named "ToExampleString ()" (in my normal date is included in the date extension). And I want to use it in my markup on the list item:
pre & lt; & Lt; Span & gt; & Lt;% # (DateTime) Eval ("Date Starred"). ToExampleString ()% & gt; & Lt; / Span & gt; & Lt; / ItemTemplate & gt;
I am getting the following error:
There is no definition for 'ToExampleString' in 'System.DateTime' and no extension method to 'ToExampleString' The first argument of the 'System.DateTime' type can be accepted (Do you have access direction or assembly reference available?)
The page can not be seen just by extension method. Thanks What do I do to get this work done? Need to take action? I think I'm seeing something stupid? Thanks
& lt;% @ import namespace =" normal.extension "%>
I believe that you have all your markup in web.config You can do this for.
Comments
Post a Comment