Monday, April 17, 2006

This is a short review because about 85% of the book is code samples.  ASP.NET 2.0 Cookbook is divided into 21 chapters, covering topics ranging from Master Pages, error handling and web parts.  The major improvements in ASP.NET 2.0 are in here, including examples of the GridView control, profiles and themes.  Every example includes a brief description of the problem to be solved, an overview of the solution, and some deeper discussion about the solution.  In all, there are 125 solutions presented in 980 pages, so you can see there is ample coverage of every solution.  As you progress through the chapter, each example builds on the skills and knowledge developed in the previous example, but is a complete example unto itself.  Additionally, every example is presented in both VB.NET and C#.  Not only is this good for cut and paste purposes, but it's a good way to practice the language you don't use primarily.  Speaking of cut-and-paste, there is a 45-day trial to the Safari Bookshelf, which will allow you to search all sorts of books, and cut and paste from the code examples.

I've obviously not used every example in the book, but he ones I have used have been useful, complete and informative.  Examples are written as inline code, so examples will work with Visual Web Developer Express, as well as Visual Studio 2005.  If you want to use the code-behind or code-beside models, you'll have to do a little translation on your own.  The code samples and sample database are available for download from thre author's website, for easier use in your projects.

I don't recommend this as your "introduction to ASP.NET 2.0 book"; this book is meant mainly for developers who have been through the basics and have some familiarity with Visual Studio or Visual Web Dev Express.  If you're familiar with ASP.NET 1.1, and want a way to get up to speed with some major improvements in ASP.NET 2.0, I think you'll find this is a good book to get you there.

Monday, April 17, 2006 5:01:25 PM (Eastern Standard Time, UTC-05:00)

If you're still formatting dates as such:

lblDate.text = datepart("d",Now) & "/" & datepartt("m",now) & "/" & datepart("yyyy",now)

then stop this instant!  Step away from the keyboard and no one gets hurt.

There are better ways in ASP.NET to format dates.  You could replace the above line of code with:

lblDate.text = getdate().tostring("MM/dd/yyyy")

and end up with exactly what you needed.  ASP.NET is full of great format strings.  Remmeber the old FormatCurrency(MyCash) command?  You can replace that with MyCash.ToString("C").  Download the .NET 2.0 SDK and look up "formatting strings"; you'll find all these goodies in there.

Monday, April 17, 2006 12:34:46 PM (Eastern Standard Time, UTC-05:00)
 Thursday, April 13, 2006

My latest ASP Alliance article has been published:

ASP.NET 2.0 brought about a number of improvements in the way configuration settings are stored and accessed. Several new configuration sections have been added to the web.config schema, settings can be updated via code, and can be more easily encrypted and decrypted than before. In this article, Richard examines these new features with the help of code samples.

Read it at http://aspalliance.com/820.

 

Thursday, April 13, 2006 9:36:33 PM (Eastern Standard Time, UTC-05:00)

Join us as Tony Casale of Communifax discusses developing custom server controls and HTTP Handlers in VS 2005.

We'll meet from 6-8 pm on April 20 at Communifax HQ; directions can be found at www.communifax.com.

Thursday, April 13, 2006 7:05:51 PM (Eastern Standard Time, UTC-05:00)

Chris Sherman at Search Engine Watch has an overview:

http://searchenginewatch.com/searchday/article.php/3598681

Thursday, April 13, 2006 6:43:36 PM (Eastern Standard Time, UTC-05:00)
 Wednesday, April 12, 2006
 Monday, April 10, 2006

If you're reading this blog, you're probably the IT manager for for family and circle of friends.  The trick to being the IT manager for this group is to maximize their benefit, while minimizing your own pain.  In such a role, I needed something "simple and easy", and one thing I checked out was Jeffrey Palermo's EZWeb.

Installation was a snap--download a ZIP from GotDotNet, and extract the contents.  Create an IIS virtual directory, drop the extracted files into the virtual dir, and grant the ASPNET (or Network Service if Win2K3) user Modify permissions on the directory (documentation says Full Control, but I haven't had any problems with Modify).  Once this is done, browse to your new virtual dir.

The first thing you'll see is the welcome page below

Click the [sign in] link, and you'll get the usual login box.  Log in with the admin credentials (admin/ezweb, in case you didn't read the welcome page)

Once you've logged in, you'll see the menu has added some administrative tasks.

Your site consists of only the Home page right now.  To add a page, click on the Manage Page link in the menu.  You'll be taken to the Page Administration.

To create a new page, click the Add button in the "Children and Hyperlinks" section.  You'll be prompted to enter the title of the new page, and if the page should open in the same window (Target = Self), or a new window (Target=Blank); if you're not using frames, the other options won't matter.

Click the Update button to save the new page.  You'll stay on the Page Administration, but you'll see your new page appear in the menu.

The page title will also appear in the browser's title bar, as well as the page title and breadcrumbs in the default skin.

If you click on the menu link to your new page, you'll have management options in your menu.

Clicking on the Edit Content link will open a rich text editor, where you can enter the text to appear on the page.  You can add and format text in Design mode, or switch to HTML mode to enter HTML code.  Switch modes by using the tabs in the lower left corner.  When you're done, click Save in the lower right corner.

To add an image to your content, you'll need to upload the images to your website.  To add them one at a time, you an use the built in File Manager tool.  The File Manager is right above the Editor, and is minimized by default.

Click on the Show link to expand the File Manager.

Click the Browse button to find the file you want to upload, then click the Upload button.  If you're uploading a file (such as an Excel spreadsheet), it will be listed in the Files column.  Images, such as GIF or PNG, will be listed in the Images column.  Note that JPG files are not supported, so you'll need to use GIF or PNG files.  After the upload, you'll receive a message that your file already exists on the server--I think that's a bug right now.

To insert the image, right-click on the image's file name, and choose Copy Shortcut.  Then click the Image button in the text editor (looks like mountains--) to open the Image Editor.  Paste the image path into Image Source box, add some ALT text, set any other image parameters, and click OK.

You'll be returned to the text editor, and your image will appear in the editor window.  As before, when you're done editing, click Save.

In this application, images, files and content don't disappear.  For each page, a new folder is created in the Images, Files and FilePageConfigProvider directories.  Images and files are stored accordingly, in the proper folders.

Page content is stored in XML files in the proper folders under FilePageConfigProvider.

If the day comes where you need a new system, you can either cut and paste your content out of the XML (provided you don't have a zillion pages), or a competent developer can write a widget to read every file and upload the content into your new system.

Monday, April 10, 2006 9:53:06 PM (Eastern Standard Time, UTC-05:00)

I was asked the other day if I knew of a DNN document library with version control.  At the time, I didn't, but I've since found one from WillowTree Software.

This is a DNN 3.1.x or later version of the Wrox Document Dontrol (DNN ported) module. This was first offered by Mark Hoskins (KodHeaz), then Robert J Collins (WillowTree Software), then Tam Tran Minh (TTT Company), and lastly (and once again) Robert J Collins (WillowTree Software).
 
You can’t beat the price—it’s free!
Monday, April 10, 2006 8:13:31 PM (Eastern Standard Time, UTC-05:00)

According to an article in today's Post-Gazette:

By the time visitors stream into Pittsburgh for the July All-Star Game, Mayor Bob O'Connor and Pittsburgh Downtown Partnership CEO Michael Edwards want them to be able to fire up their laptops and connect to the Internet from anywhere in the Golden Triangle. The system may tie into another wireless network the Pirates want to deploy in PNC Park.

That would be the MLB All-Star game, coming to PNC Park this summer.

Monday, April 10, 2006 6:25:40 PM (Eastern Standard Time, UTC-05:00)
 Sunday, April 09, 2006

I've used CSE HTML Validator for quite some time.  I started with ther free version, and upgraded to the full version after using it for a while.  They've recently released a free online HTML validator, based on their Lite version engine.  Find it at http://onlinewebcheck.com/.  You can submit the URL of a page, upload a page, or paste in a snippet.  Very cool, and you can't beat the price.

Sunday, April 09, 2006 10:37:29 AM (Eastern Standard Time, UTC-05:00)

In my article on Preventing Page Review After Logout With Forms Authentication, I talked about several HTTP headers that can be used to direct browsers not to cache pages locally.  In one comment, a reader said they had used the article's code, but Firefox was still caching pages.  Another reader left a comment about using the "cache-control: no-store" header to prevent Firefox from caching pages.  If you see that Firefox is caching secured pages, try adding this header to your pages.  If possible, add it to your master page or page template.

ASP.NET, you can set this header by using the HttpCachePolicy.SetNoStore method.  Put this in your page_load at the latest.  You can also set this in your page's HEAD section  by adding the following line of code:

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

In the IIS control panel, you can set headers to be automatically added to every response.  This is discussed briefly at http://support.microsoft.com/kb/815313/, but if you're in a shared host environment, you probably don't have access to the IIS control panel.

The "Cache-Control: No Store" header can cause problems with PDF files in IE 6.  Microsoft has a KB article on this at http://support.microsoft.com/default.aspx?scid=kb;en-us;812935.  File downloads via SSL may also beimpacted if you use this header; see http://support.microsoft.com/?kbid=323308 for more details.  This second article involves a registry edit.

Also, remember that browsers need to cache image files if you're using image rollovers, so be careful where you use any of these headers.  You might mess up your menu.

Sunday, April 09, 2006 10:17:29 AM (Eastern Standard Time, UTC-05:00)
 Wednesday, April 05, 2006
Holy cow, nice ballpark. Pirates vs. Brewers, 1-0, bottom of the 2nd. 18 rows behind Pirates' dugout. Sweet!
Wednesday, April 05, 2006 7:46:20 PM (Eastern Standard Time, UTC-05:00)