Items By Type: Snippet
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: 840 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: 1120 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: 751 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: 881 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: 18006 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: 1655 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: 4692 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: 2628 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: 4333 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: 9509 times
Splitting strings with C# and VB.NET
Mikesdotnetting
-
20 May 2007 20:21
Examples of splitting strings into arrays using C# and VB.Net, both with the String.Split() method, and the Regular Expressions Split() method.
Click to read more about Splitting strings with C# and VB.NET ...
Javascript functions for form fields
Mikesdotnetting
-
12 May 2007 22:54
A number of useful functions for accessing various properties and values of form fields.
Click to read more about Javascript functions for form fields ...
Filed under:
Javascript
as
Snippet
Viewed: 2324 times
Binding data to a DropDownList with ADO.NET
Mikesdotnetting
-
11 May 2007 22:35
Using ADO.NET to pull data from the Northwind database (Access version), using the saved query Current Product List.
Click to read more about Binding data to a DropDownList with ADO.NET ...
Filed under:
ASP.NET 2.0
MS Access
ADO.NET
as
Snippet
Viewed: 2294 times
Send form content by email in ASP.NET
Mikesdotnetting
-
10 May 2007 22:53
Using ASP.NET to send the contents of a form by email is a common requirement. This sample looks at generating an email using System.Net.Mail in both plain text and html format from a very basic Contact Us form.
Click to read more about Send form content by email in ASP.NET ...
Filed under:
C#
ASP.NET 2.0
VB.Net
as
Snippet
Viewed: 16094 times


