Latest Entries

Splitting strings with C# and VB.NET

calendar_today 20 May 2007 20:21

C# VB.Net

Examples of splitting strings into arrays using C# and VB.Net, both with the String.Split() method, and the Regular Expressions Split() method.

C# Regular Expressions Cheat Sheet

calendar_today 19 May 2007 20:36


Cheat sheet for C# regular expressions metacharacters, operators, quantifiers etc

Programmatically accessing data from DataSource controls

calendar_today 16 May 2007 10:06


For the main part, the DataSource controls are incredibly easy to work with. You just drag them onto your page in Design View, wire them up to a connection and provide some kind of command (ad hoc sql query or the name of a stored procedure - saved query in Access), then link them to a databound control on the page using its DataSource property. Then you run the page and all your data appears. But what if you want to get at one or more values from the returned data to do something else with it, like display it in a control that doesn't expose a DataSource property?

VBScript Regular Expressions Cheat Sheet

calendar_today 14 May 2007 08:44


Metacharacters for use with VBScript regular expressions

Javascript functions for form fields

calendar_today 12 May 2007 22:54


A number of useful functions for accessing various properties and values of form fields.

Binding data to a DropDownList with ADO.NET

calendar_today 11 May 2007 22:35


Using ADO.NET to pull data from the Northwind database (Access version), using the saved query Current Product List.

Send form content by email in ASP.NET

calendar_today 10 May 2007 22:53

C# ASP.NET 2.0 VB.Net

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.

ASP.NET and Ajax - using XmlHttpRequest

calendar_today 08 May 2007 17:32

ASP.NET 2.0 AJAX Javascript

If you are not interested in using the ASP.NET AJAX library offered for ASP.NET, but would like to feature small amounts of AJAX functionality on your pages, you can do this easily with some javascript and a receptive page.

AJAX and Classic ASP

calendar_today 06 May 2007 23:29

Classic ASP VBScript AJAX Javascript

Using the xmlhttpserver object in javascript to request an asp page containing script to output text.

Analyse the tables and saved queries in an Access database with ADOX

calendar_today 06 May 2007 22:34

Classic ASP VBScript MS Access

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.

How to highlight a GridView's row on hover

calendar_today 06 May 2007 20:50

C# ASP.NET 2.0 Javascript

As the user hovers over each row, it becomes highlighted, with the help of a small amount of javascript.

How to make an ASP.NET Table row highlight and become clickable

calendar_today 06 May 2007 20:38

C# ASP.NET 2.0 Javascript HTML

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.

How to center the content of a web page

calendar_today 05 May 2007 20:48


This question gets asked very often in the forums and newsgroups, and is very easy once you know how.

How to force a scrollbar for centered web pages

calendar_today 05 May 2007 20:45


If you have centered web pages, there can be times where the depth of content doesn't reach the bottom of the window browser, so no scroll bar appears. Navigating between long and short pages can give the appearance of the centered content "jumping" from side to side.

Include contents of an html page in an aspx page

calendar_today 05 May 2007 20:44


If you are creating a new ASP.NET application, but have a huge collection of existing content in html files, one option is to move all the content into a database and generate pages dynamically. However, migration to a database can be a time-consuming task depending on the volume of content. So wouldn't it be easier to somehow import the relevant parts of the existing html pages into your aspx page?

Javascript 24 hour clock

calendar_today 01 May 2007 22:54


A snippet for a javascript clock showing time in 24 hours with seconds

Getting various bits of URL with C#

calendar_today 27 April 2007 21:49

C# ASP.NET 2.0

Need some bit or all of the URL for any reason?

Parameter Queries in ASP.NET with MS Access

calendar_today 13 April 2007 22:17


A selection of code samples for executing queries against MS Access using parameters.

Paging long articles in ASP.NET using C#

calendar_today 09 April 2007 21:44

C# ASP.NET 2.0

Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that gets posted to a database.

Regular Expressions and VBScript

calendar_today 09 April 2007 12:42

Classic ASP VBScript

Regular Expressions provide a much more powerful and efficient way of manipulating strings of text than the use of a variety of standard string functions. They have a reputation of being cryptic and difficult to learn, but are actually quite easy to learn and use.