5 items found in the Extension Method Category
Why You Can't Use Extension Methods With A WebGrid
Mikesdotnetting
-
27 January 2011 12:58
An interesting question came up recently on the ASP.NET forums. In it, the questioner was attempting to use my Chop() extension method to limit the number of characters in a WebGrid column but it wouldn't work. At first, I was a little stumped, so I tried it myself and got an error message:
Click to read more about Why You Can't Use Extension Methods With A WebGrid ...
Filed under:
Extension Method
ASP.NET Web Pages
WebMatrix
as
Snippet
Viewed: 2201 times
WebMatrix - Database Helpers for IN Clauses
Mikesdotnetting
-
11 September 2010 09:35
There are times when you want to query a database for records matching a range of values, but you do not know what those values are, or even how many there are at design time. You could dynamically build your WHERE clause with multiple ORs, or you can use the SQL IN clause - except that the current database helpers in WebMatrix don't make this easy. It's about time that was fixed....
Click to read more about WebMatrix - Database Helpers for IN Clauses ...
Filed under:
Extension Method
ASP.NET Web Pages
WebMatrix
Razor
as
Tutorial
Viewed: 4056 times
Converting URLs Into Links With Regex
Mikesdotnetting
-
22 May 2010 22:56
Following on from the recent spate of extensions methods I've posted, here's another I use to convert URLs and email addresses into links within HTML. You may want to restrict users from submitting HTML tags via forms in your application, which means that URLs and email addresses that they submit appear as plain text unless they are subjected to some kind of processing.
Click to read more about Converting URLs Into Links With Regex ...
Filed under:
C#
Extension Method
as
Snippet
Viewed: 2890 times
Highlighting Keywords Found In Search Results
Mikesdotnetting
-
22 May 2010 19:41
A common question in the forums is how to highlight key words found in search results. Here's an extension method that does that, both for partial matches, or whole word matches.
Click to read more about Highlighting Keywords Found In Search Results ...
Filed under:
C#
ASP.NET 3.5
Extension Method
ASP.NET Web Forms
as
Snippet
Viewed: 3202 times
Displaying The First n Characters Of Text
Mikesdotnetting
-
16 May 2010 09:59
Displaying the first n characters of a block of text on a page without chopping words off halfway through is a common requirement. There are a number of ways to achieve this, but here's an extension method that you might find useful.
Click to read more about Displaying The First n Characters Of Text ...
Filed under:
C#
ASP.NET 3.5
Extension Method
as
Snippet
Viewed: 3537 times


