Website development and design blog, tutorials and inspiration


C# Tutorials for people who wish to learn the Microsoft .Net Framework and C# language. We take you from the basic programming concepts all the way through to advanced object orientation techniques, scalable solutions and multi-tier applications.


Get Week Commencing from DateTime in C#
4th March 2010C#
This snippet will calculate the date of the start of the week from a given DateTime and return a DateTime containing the week commencing date.
Replace First or Last Occurrence of a String with C#
5th February 2010C#
This snippet provides two functions to replace only the first or the last occurrence of a string within a larger string. Using the Replace method will replace all occurrences found.
Get String In Between Two Others with C#
5th February 2010C#
This useful code snippet will parse a string and return the contents between two tokens. This was originally used as a quick and dirty way to get the contents of an XML string, however it has found many other uses since.
ASP.Net Disable Buttons during AJAX Postback
5th February 2010C#
It is an often overlooked requirement to disable controls on postback during an AJAX postback event to prevent repetitive clicking, a minor problem which can become more serious depending on the action being taken. Payment processing, for example, can result in multiple payments or orders if not handled correctly.
Reading and Writing INI Files with C#
1st February 2010C#
This short snippet is another tool in my utility class. You can use it to quickly read and write settings from an old school INI configuration file. Yes I still use INI files!
Querying iSeries DB2 with ADO.Net
29th January 2010C#
In this tutorial, I will show you how to connect ADO.Net to an IBM DB2 server such as a system I, iSeries or AS400. We will also look at using parameters to create secure query strings.
Using C# to Recursively Call FindControl in ASP.Net
29th January 2010C#
In ASP.Net I often need to use the recursively use FindControl to get an object reference to a control on the ASPX page. The only problem with this is that you need to know the control that it is contained with. This recursive method will search for a given control within a parent control and all it's child controls.
Ultimate Guide to FTP using C#
28th January 2010C#
How to use the FtpWebRequest and FtpWebResponse classes to create a FTP utility class which will allow us to retrieve a directory listing, download files, upload files and delete files.