Sunday, October 30, 2005 5:01:10 AM UTC :: Filed Under ASP.NET

When using a GridView in ASP.NET 2.0, note that you must set HtmlEncode = False in addition to setting the DataFormatString or else the formatting will not work:

image0011.png

Sunday, October 30, 2005 3:15:06 AM UTC :: Filed Under ASP.NET

Because of the cost and portability, I had a tendency to use Microsoft Access databases as the back-end for many of my web sites.  Microsoft recently released Visual Studio 2005 which includes SQL Express 2005.  SQL Express is designed to be used in-place of Access for low volume web sites.

With this in-mind, my first thought was, “How to I upsize my Access 2000 databases to SQL Express 2005?”  It’s surprisingly easy.

How to Upsize an Access 2000 Database to an SQL Express 2005 Database

1. Open the Access database you wish to up-size.
 
2. Select Tools > Database Utilities > Upsizing Wizard



3. Select Create new database and then Next >
 
4. This is probably the hardest part.  The instance of your SQL Express database won’t show-up in the database dropdown list.   For the name of your SQL Server, enter MACHINENAME\SQLExpress or .\SQLExpress.  The former worked for me:



5. Make sure you name the database, click Next >, and the rest is the same as it’s always been.

If you find that Access can’t connect to the SQL Express database, this FAQ might be helpful:

FAQ: How to connect to SQL Express from "downlevel clients"(Access 2003, VS 2003, VB 6, etc(basically anything that is not using .Net 2.0 or the new SQL Native Client))

You’ll also likely want to bookmark the Microsoft SQL Express Blog to stay informed.

Friday, October 28, 2005 7:49:44 PM UTC :: Filed Under ASP.NET

I recently spent a considerable amount of time converting a client site from not following any particular standard to using the XHTML 1.0 Transitional standard.  This was a difficult task since the site was created with VisualStudio.NET 2003 which doesn’t care much about standards!  As a result, I spent most of my time designing pages in Macromedia Dreamweaver MX and doing the code in VS.NET (Can you say, “pain-in-the-butt”?)

In converting this site to XHTML, I learned a lot about CSS and the benefits of separating HTML from styles… so much that I have no real desire to go back to the old sloppy way of coding.
With the release of VisualStudio.NET 2005, one of the great features of this new tool is that it creates XHTML 1.0 Transitional code by default!  This doesn’t necessarily mean that I can through Dreamweaver out the window, but at least I can open my HTML and ASPX pages up in VS.NET and know it isn’t going to re-write and mangle my code.

The following article from the Microsoft ASP.NET Developer Center is very helpful in explaining the new features of VS.NET 2005 in regards to web standards:

Building ASP.NET 2.0 Web Sites Using Web Standards

If XHTML Transitional isn't good enough and XHTML Strinct is preferred... no problem!  Add the following in your project's web.config file:

Note that in addition to changing the runtime behavior to be strict, you can also then change the validation drop-down in the VS toolbar to validate html/javascript against XHTML strict as well.
Friday, October 28, 2005 7:35:34 PM UTC :: Filed Under ASP.NET

The more articles I read about VisualStudio.NET 2005, the more excited I get!  This article from Scott Guthrie explains how to use the new Custom Item Template feature in VS.NET 2005 which will help eliminate the need to waste time “setting-up” a newly created page ASPX page:

Defining Custom Item Templates in Web Projects with VS 2005

A helpful MSDN article relating to the templates:

MSDN: Visual Studio Template Reference

Friday, October 28, 2005 6:56:15 PM UTC :: Filed Under ASP.NET
From Scott Guthrie's blog:Basically, if you place a file with this name in the root of a web application directory, ASP.NET 2.0 will shut-down the application, unload the application domain from the server, and stop processing any new incoming requests for that application.  ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).

This provides a convenient way to take down your application while you are making big changes or copying in lots of new page functionality (and you want to avoid the annoying problem of people hitting and activating your site in the middle of a content update).  It can also be a useful way to immediately unlock and unload a SQL Express or Access database whose .mdf or .mdb data files are residing in the /app data directory.

Once you remove the app offline.htm file, the next request into the application will cause ASP.NET to load the application and app-domain again, and life will continue along as normal.

Friday, October 28, 2005 6:03:34 PM UTC :: Filed Under ASP.NET

I’m not sure if it’s a sign of getting old or just my personality type, but I like things to be organized… and that includes the files in my web projects.  Lucky for me, ASP.NET Grand-Pubba Scott Guthrie has written a nice article demonstrating ways to clean-up and organize your web projects in VisualStudio.NET 2005:

Some Techniques for Better Managing Files in Visual Studio 2005 Web Projects

Navigation
On this page....
Search
Archives
<October 2005>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
Categories
Contact me
Send mail to the author(s) Contact Todd M. Taylor