Archive From May 2007

Basic file management with System.IO in ASP.NET

29 May 2007 12:37

C# ASP.NET 2.0

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 ...

Viewed 20351 times

0 Comments for this item

VBScript to C# - Equivalent string functions

28 May 2007 21:18

VBScript C#

A Cheat Sheet containing the VBScript string functions and their equivalent methods in C#.

Click to read more about VBScript to C# - Equivalent string functions ...

Viewed 23132 times

1 Comment for this item

C# Regular Expressions - the basics

24 May 2007 22:01

C#

The is a brief overview of the main classes and methods in the System.Text.RegularExpressions namespace. It doesn't cover Regex patterns in any real depth at all, but gives an introduction to the power of regular expressions using C#.

Click to read more about C# Regular Expressions - the basics ...

Viewed 63402 times

0 Comments for this item

How to read a remote web page with ASP.NET 2.0

21 May 2007 21:38

C# ASP.NET 2.0

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 ...

Viewed 118472 times

8 Comments for this item

Splitting strings with C# and VB.NET

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.

Click to read more about Splitting strings with C# and VB.NET ...

Viewed 47407 times

1 Comment for this item

C# Regular Expressions Cheat Sheet

19 May 2007 20:36

C#

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

Click to read more about C# Regular Expressions Cheat Sheet ...

Viewed 920894 times

37 Comments for this item

Programmatically accessing data from DataSource controls

16 May 2007 10:06

C# ASP.NET 2.0 ADO.NET

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?

Click to read more about Programmatically accessing data from DataSource controls ...

Viewed 114895 times

8 Comments for this item

VBScript Regular Expressions Cheat Sheet

14 May 2007 08:44

VBScript

Metacharacters for use with VBScript regular expressions

Click to read more about VBScript Regular Expressions Cheat Sheet ...

Viewed 53147 times

0 Comments for this item

Javascript functions for form fields

12 May 2007 22:54

Javascript

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

Click to read more about Javascript functions for form fields ...

Viewed 11421 times

3 Comments for this item

Binding data to a DropDownList with ADO.NET

11 May 2007 22:35

ASP.NET 2.0 MS Access ADO.NET

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 ...

Viewed 15225 times

0 Comments for this item

Send form content by email in ASP.NET

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.

Click to read more about Send form content by email in ASP.NET ...

Viewed 366930 times

36 Comments for this item

ASP.NET and Ajax - using XmlHttpRequest

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.

Click to read more about ASP.NET and Ajax - using XmlHttpRequest ...

Viewed 80329 times

9 Comments for this item

AJAX and Classic ASP

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.

Click to read more about AJAX and Classic ASP ...

Viewed 80855 times

7 Comments for this item

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

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.

Click to read more about Analyse the tables and saved queries in an Access database with ADOX ...

Viewed 7437 times

0 Comments for this item

How to highlight a GridView's row on hover

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.

Click to read more about How to highlight a GridView's row on hover ...

Viewed 18310 times

2 Comments for this item

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

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.

Click to read more about How to make an ASP.NET Table row highlight and become clickable ...

Viewed 92317 times

4 Comments for this item

How to center the content of a web page

05 May 2007 20:48

HTML CSS

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

Click to read more about How to center the content of a web page ...

Viewed 31324 times

4 Comments for this item

How to force a scrollbar for centered web pages

05 May 2007 20:45

HTML CSS

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.

Click to read more about How to force a scrollbar for centered web pages ...

Viewed 7750 times

0 Comments for this item

Include contents of an html page in an aspx page

05 May 2007 20:44

ASP.NET 2.0 HTML

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?

Click to read more about Include contents of an html page in an aspx page ...

Viewed 68346 times

5 Comments for this item

Javascript 24 hour clock

01 May 2007 22:54

Javascript

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

Click to read more about Javascript 24 hour clock ...

Viewed 22045 times

1 Comment for this item

Recent Comments

Pam 30/08/2017 11:30
In response to Sending Email in Razor Pages
Mike, RazorPages sound like a nice choice for somebody still working in ASP classic who wants to to...

Robby Robson 15/08/2017 00:43
In response to Routing in Razor Pages
Mike: great stuff. Now that .Core Standard 2.0 is formally out, how soon will you rewrite your book...

Satyabrata Mohapatra 28/07/2017 08:59
In response to Sending Email in Razor Pages
Bit off topic, but congratulation sir for your MVP award. You deserve it !!!...

Satyabrata Mohapatra 23/07/2017 16:43
In response to Razor Pages - The Elevator Pitch
@Dale Severin You can continue to build apps using asp.net web pages....

Satyabrata Mohapatra 23/07/2017 16:40
In response to Sending Email in Razor Pages
Thanks for sharing...learned a lot...

Gfw 22/07/2017 11:53
In response to Sending Email in Razor Pages
Question... Does System.Net.Mail support SSL?...

Dale Severin 20/07/2017 03:38
In response to Razor Pages - The Elevator Pitch
I work with razor web pages extensively. I appreciate the rapid development it permits me to I am as...

Obinna Okafor 14/07/2017 01:19
In response to Routing in Razor Pages
Thank you, Mike. Good post....

Satyabrata Mohapatra 11/07/2017 16:02
In response to Routing in Razor Pages
Very powerful routing system!!...

Cyrus 05/07/2017 03:41
In response to Razor Pages - Getting Started With The Preview
How can I trim packages and services as much as possible to use just razor pages? I don’t want to to...