Items By Type: Snippet
Displaying Search Results In A WebGrid
Mikesdotnetting
-
27 August 2011 16:57
A number of people have run into problems when trying to combine a search or filter form, and a WebGrid. The main issue that arises is when paging or sorting the search result or a filtered subset of it. Here, I look at the cause of the problem and what you can do about it.
Click to read more about Displaying Search Results In A WebGrid ...
Filed under:
jQuery
ASP.NET Web Pages
WebMatrix
Razor
WebGrid
as
Snippet
Viewed: 15069 times
How To Maintain Scroll Position When Paging Or Sorting A WebGrid
Mikesdotnetting
-
23 August 2011 21:13
This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to maintain scroll position on the page when paging or sorting the WebGrid.
Click to read more about How To Maintain Scroll Position When Paging Or Sorting A WebGrid ...
Filed under:
jQuery
ASP.NET Web Pages
WebMatrix
Razor
WebGrid
as
Snippet
Viewed: 6892 times
How To Make A WebGrid Row Clickable
Mikesdotnetting
-
23 August 2011 11:23
This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to make an entire row clickable so that the user is taken to another page that displays details of the selected row.
Click to read more about How To Make A WebGrid Row Clickable ...
Filed under:
jQuery
ASP.NET Web Pages
WebMatrix
Razor
WebGrid
as
Snippet
Viewed: 31013 times
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
WebGrid
as
Snippet
Viewed: 5342 times
Finding Yesterday in SQL and C#
Mikesdotnetting
-
12 July 2010 21:27
Here's something that comes up often in forums - How To Find Yesterday in SQL or C#. Piece of cake, if you know how, but tricky if you don't. And especially tricky to get the right value if you are not clear on the requirement.
Click to read more about Finding Yesterday in SQL and C# ...
Named Anchors And MVC Urls
Mikesdotnetting
-
14 June 2010 10:15
Named Anchors are used to generate links to specific locations within a web document. Unless you are careful, you may end up having a little trouble getting these to work using the MVC LinkExtension helpers.
Click to read more about Named Anchors And MVC Urls ...
Filed under:
ASP.NET MVC
as
Snippet
Viewed: 7434 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: 5793 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: 8720 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: 8397 times
Referencing CheckBoxes in GridView, Repeater and DataList controls
Mikesdotnetting
-
30 August 2007 10:29
If you want to find which CheckBoxes were selected in a multiple record DataBound control, the way that you you do it depends on the type of control you use. These examples demonstrate a CheckBox control being added to a GridView, Repeater and a DataList. For simplicity, I have placed all three controls on the same page, and used the Access version of theNorthwind database. One AccessDataSource control is used to bind the results of "SELECT [CategoryID], [Description], [CategoryName] FROM [Categories]" to all three controls.
Click to read more about Referencing CheckBoxes in GridView, Repeater and DataList controls ...
Filed under:
ASP.NET 2.0
ASP.NET Web Forms
as
Snippet
Viewed: 49629 times
List the contents of a folder and link to each file
Mikesdotnetting
-
10 August 2007 21:33
Iterating the contents of a folder is straightforward using classes from System.IO, and listing them as links to the actual file just requires a bit of html added to each file name.
Click to read more about List the contents of a folder and link to each file ...
Filed under:
ASP.NET 2.0
as
Snippet
Viewed: 4879 times
Exporting data to a CSV, tab delimited or other text format
Mikesdotnetting
-
02 August 2007 23:41
A question that often comes up in forums is how to export data to a CSV file, or other text format. Here's a method that takes data from a DataReader and writes it to a file.
Click to read more about Exporting data to a CSV, tab delimited or other text format ...
Filed under:
ASP.NET 2.0
ADO.NET
as
Snippet
Viewed: 18165 times
A more efficient RSS feed with C#
Mikesdotnetting
-
06 June 2007 23:15
The contents of an RSS feed only change when items that appear in it are added or amended, so the feed created in the previous article (Create an RSS Feed In ASP.NET 2.0 C#) is rather inefficient, in that the output is generated everytime the feed is requested. Here's an improvement.
Click to read more about A more efficient RSS feed with C# ...
Filed under:
C#
ASP.NET 2.0
as
Snippet
Viewed: 6407 times
Basic file management with System.IO in ASP.NET
Mikesdotnetting
-
29 May 2007 12:37
Some basic file and folder management tasks that require the use of classes inside System.IO
Click to read more about Basic file management with System.IO in ASP.NET ...
Filed under:
C#
ASP.NET 2.0
as
Snippet
Viewed: 12099 times
How to read a remote web page with ASP.NET 2.0
Mikesdotnetting
-
21 May 2007 21:38
Two classes in the System.Net namespace make it very easy to obtain the html of a remote web page. These are the HttpWebRequest and HttpWebResponse. Here's a quick demo.
Click to read more about How to read a remote web page with ASP.NET 2.0 ...
Filed under:
C#
ASP.NET 2.0
as
Snippet
Viewed: 40785 times


