Items By Type: Snippet
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. More...
Filed under: ASP.NET 2.0 as Snippet
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. More...
Filed under: ASP.NET 2.0 as Snippet
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. More...
Filed under: ASP.NET 2.0 ADO.NET as Snippet
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. More...
Filed under: C# ASP.NET 2.0 as Snippet
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 More...
Filed under: C# ASP.NET 2.0 as Snippet
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. More...
Filed under: C# ASP.NET 2.0 as Snippet
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. More...
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. More...
Filed under: Javascript as Snippet
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. More...
Filed under: ASP.NET 2.0 MS Access ADO.NET as Snippet
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. More...
Filed under: C# ASP.NET 2.0 VB.Net as Snippet
AJAX and Classic ASP
Mikesdotnetting
-
06 May 2007 23:29
Using the xmlhttpserver object in javascript to request an asp page containing script to output text. More...
Filed under: Classic ASP VBScript AJAX Javascript as Snippet
Analyse the tables and saved queries in an Access database with ADOX
Mikesdotnetting
-
06 May 2007 22:34
The following code will enumerate the tables and their properties, together with the queries in an Access database. Saved SELECT queries are referenced using the Views collection, and INSERT, UPDATE and DELETE queries are referenced from the Procedures collection.
More...Filed under: Classic ASP VBScript MS Access as Snippet
How to highlight a GridView's row on hover
Mikesdotnetting
-
06 May 2007 20:50
As the user hovers over each row, it becomes highlighted, with the help of a small amount of javascript. More...
Filed under: C# ASP.NET 2.0 Javascript as Snippet
How to make an ASP.NET Table row highlight and become clickable
Mikesdotnetting
-
06 May 2007 20:38
For those people who like to output their data to an asp:Table, highlighting the entire row and making it clickable can make it obvious to the user that some action is expected from them. This emulates the behaviour that can be found in some desktop applications. All that's needed for this is a bit of javascript, and the use of AddAttributes() for the table rows. More...
Filed under: C# ASP.NET 2.0 Javascript HTML as Snippet
How to center the content of a web page
Mikesdotnetting
-
05 May 2007 20:48
This question gets asked very often in the forums and newsgroups, and is very easy once you know how. More...

