Printer Friendly Version      Send     
Click to Rate and Give Feedback
Related Articles

Silverlight is powerful enough to let you easily build an image magnification feature for you web site with very little code, most of which is XAML. Find out how.

Jeff Prosise

MSDN Magazine November 2008

...

Read more!

Our security experts present 10 vulnerable pieces of code. Your mission is to find the holes (a.k.a. bad security practices) in the code.

Michael Howard and Bryan Sullivan

MSDN Magazine November 2008

...

Read more!

Ken Getz shows how the CollectionChanged event lets you reflect changes to your underlying data source in your bound data controls.

Ken Getz

MSDN Magazine December 2008

...

Read more!

This month Dino Esposito explains how the browser interoperability layer in Silverlight addresses a number of your Silverlight / Web page interaction needs.

Dino Esposito

MSDN Magazine November 2008

...

Read more!

This month Scott looks at improving development skills, writing regular expressions, a web scheduling control and a SQL tips blog.

Scott Mitchell

MSDN Magazine November 2008

...

Read more!

Also by this Author

This month, more of the tools you need to get your job done.

Scott Mitchell

MSDN Magazine December 2007

...

Read more!

This month test your web site on many platforms and browsers without setting up a test environment, use mock objects for unit testing, and visit Raymond Chen.

Scott Mitchell

MSDN Magazine June 2008

...

Read more!

This month, find performance and memory bottlenecks, essential security reading, and more.

Scott Mitchell

MSDN Magazine July 2007

...

Read more!

This month Scott looks at improving development skills, writing regular expressions, a web scheduling control and a SQL tips blog.

Scott Mitchell

MSDN Magazine November 2008

...

Read more!

This month, a better design-time experience for Web apps, Scott Guthrie's blog, extending Extend Lutz Roeder's Reflector, and more.

Scott Mitchell

MSDN Magazine March 2008

...

Read more!

Popular Articles

A Sidebar gadget is a powerful little too that's surprisingly easy to create. Get in on the fun with Donavon West.

Donavon West

MSDN Magazine August 2007

...

Read more!

When incorporating the ASP.NET DataGrid control into your Web apps, common operations such as paging, sorting, editing, and deleting data require more effort than you might like to expend. But all that is about to change. The GridView control--the successor to the DataGrid-- extends the DataGrid's functionality it in a number of ways. First, it fully supports data source components and can automatically handle data operations, such as paging, sorting, and editing, as long as its bound data source object supports these capabilities. In addition, ...

Read more!

Kenny Kerr sings the praises of the new Visual C++ 2008 Feature Pack, which brings modern conveniences to Visual C++.

Kenny Kerr

MSDN Magazine May 2008

...

Read more!

James Avery does it again with his popular list of developer tools. This time he covers the best Visual Studio add-ins available today that you can download for free.

James Avery

MSDN Magazine December 2005

...

Read more!

This article presents an overview of the motivation behind new techniques that decompose problems into independent pieces for optimal use of parallel programming.

David Callahan

MSDN Magazine October 2008

...

Read more!

Our Blog

Visual Studio 2008 Team Foundation Server Build (better known as Team Build) is a core feature of Team Foundation Server 2008. Microsoft designed Team Build to be an industrial-strength build automation tool.

In the November 2008 issue of MSDN Magazine, Brian A. Randell introduces you to Team Build 2008 and walks you through the process ...

Read more!

So many factors can affect the performance of a Web page—the distance between server and client, the size of the elements on the page, how the browser loads these elements, available bandwidth. Finding those bottlenecks and identifying the culprits is no easy task.

In the November 2008 issue of MSDN Magazine, Jim Pierson introduces ...

Read more!

Every month, the CLR team gives us insight into the core of managed code, .NET programming best practices, technologies underlying the CLR and .NET Framework, and other tips and suggestions.

In the December 2008 issue of MSDN Magazine, Erika Fuentes and Eric Eilebrecht cover some common issues developers encounter when tuning ...

Read more!

Earlier this year MSDN Magazine embarked on a collaborative project with Behind the Code, an interview program airing on MSDN Channel 9. In this program, Robert Hess interviews prominent developers at Microsoft, and those developers also write a column for { End Bracket } in MSDN Magazine. In the newest interview, Richard Ward talks about working on the core infrastructure components of future versions of Windows, as well as ...

Read more!

It’s helpful to think about secure design from a more holistic perspective by using threat models to drive your security engineering process.

In the November 2008 issue of MSDN Magazine, Michael Howard proposes using the threat model to help drive other SDL security requirements, primarily code review priority, fuzz testing priority, ...

Read more!

Toolbox
ASP.NET Controls, FTP, and More
Scott Mitchell

Make Your ASP.NET App More Appealing
Since most ASP.NET applications are merely data entry forms accessible over the Internet, developers usually have their time monopolized by important yet bland issues such as reporting, data-entry form design, and input validation. This focus is evident in third-party control suites, which typically have a grid control as their flagship product.
While an application's substance is paramount, the importance of an intuitive and aesthetic user interface should not be discounted. You won't find any grid components in the ASPxperience Suite 1.1 by Developer Express, but you will find 18 Web controls that are designed to enhance your Web application's aesthetics and usability by presenting information in interesting and attractive ways.
The 18 controls that make up the suite specialize in navigation, layout, and application flow control. For example, the ASPxDataView control displays tabular data in columns and rows but, unlike ASP.NET's blocky GridView control, the ASPxDataView control can span data across multiple columns or rows, allows for a fine detail of customization, and offers an improved paging interface. The ASPxSiteMapControl offers a variety of eye-pleasing ways to display the Web site's navigational structure, which can be specified programmatically or from a hierarchical data source, such as an XmlDataSource or SiteMapDataSource.
The controls that impressed me the most in the ASPxperience Suite were the ASPxCloudControl and ASPxTimer controls. The ASPxCloudControl renders a tag cloud, which is a visual metaphor that succinctly depicts a weighted list. Each item in a tag cloud is associated with some value, and the greater that value is with respect to other items in the cloud, the larger that item's text appears. This interface enables a visitor to quickly ascertain how the value of one item compares to the others. The ASPxTimer control creates a client-side timer component without requiring you to write any timer-related JavaScript code. Moreover, the rendered timer component includes a client-side API for starting and stopping the timer as well as responding to tick events.
The controls' appearances are very customizable and can be configured programmatically or declaratively and with the aid of formatting wizards. Furthermore, many of the ASPxperience Suite controls use or can be configured to use AJAX techniques to enhance the user experience. All major browsers are supported, including Internet Explorer®, Firefox, Netscape, Opera, and Safari.
Price: $249 per developer license; $299 for a license plus source code.
The Intuitive ASPxCloudControl  (Click the image for a larger view)

Comprehensive FTP Library Is User Friendly
The File Transfer Protocol (FTP) is an open and well-known protocol for exchanging files between a server and a client over a network. There are many server and client implementations available. Microsoft® Internet Information Services (IIS), for example, includes an FTP service, and there are plenty of both free and commercial standalone FTP client applications. Even your Web browser can double as an FTP client.
While the abundance of FTP client applications is beneficial for end users, as developers we are more interested in communicating with FTP servers through programmatic interfaces. The Microsoft .NET 2.0 Framework includes classes for sending and retrieving files from an FTP server (see the FtpWebRequest and FtpWebResponse classes in the System.Net namespace). There are also third-party FTP libraries that add features not found in the .NET Framework. One such library is FTP for .NET 2.0 by Rebex, which provides a comprehensive API for connecting, uploading, and downloading files to and from an FTP server, with support for both .NET and .NET Compact Framework applications. FTP for .NET allows for synchronous and asynchronous operations, binary and ASCII file transfers, and non-transfer related FTP functionality, such as creating and deleting files and folders on the FTP server.
What I liked best about FTP for .NET was its concise, easy-to-use API. The Ftp class makes up the core of the API. To start communicating with an FTP server, simply create an instance of this class and call its Connect method, passing in the FTP server name and port number. If you are working with an FTP server that does not allow anonymous visitors, use the Login method to provide your credentials. Uploading and downloading files is as simple as calling the PutFile and GetFile methods. The same straightforward API extends to FTP for .NET's other functions. In short, this product makes it possible to tackle common and tricky FTP tasks alike in a few lines of terse, readable code. And to help you get started, FTP for .NET ships with several helpful examples that showcase using the library in both command-line and Windows® Forms applications.
Keep in mind that FTP is inherently insecure since all communications occur in plaintext. There are two alternative FTP specifications that add secure communications: FTP/SSL, also called FTP over SSL; and SSH File Transfer Protocol (SFTP). Rebex offers a separate product line that adds support for the FTP/SSL and SFTP standards.
Price: $249 per developer license; source code available for $999 per license.
  (Click the image for a larger view)

Rich Imaging Support
If you have ever created or worked on an application that needed to manipulate or allow users to edit images, there's a strong chance you have spent time poring through the classes in the System.Drawing namespace. Sadly, .NET's built-in imaging classes provide such a low-level interface that even the simplest tasks can require a large amount of time, effort, and code. Moreover, the framework includes only limited image-related user interface controls. The good news is that there are many third-party products that abstract the complexities of GDI+ in powerful and easy-to-use imaging APIs. One such product is DotImage Photo Pro 5.0 by Atalasoft, which includes a robust imaging API as well as imaging controls for Windows Forms and ASP.NET applications.
To start working with an image, simply create a new Workspace object and use its Open method, passing in the path or URL to the image. Once a Workspace has been loaded, use its ApplyCommand method to perform any number of image manipulations. These include effects such as adding a drop shadow or applying a grayscale, cropping, adjusting the transparency, changing the palette, resizing, and performing transformations (image skewing, rotating, flipping, and so on). This succinct and uncomplicated API results in tight, readable code. For example, opening an image and saving a thumbnail requires just three lines of code.
DotImage Photo Pro also includes UI imaging controls for both Web and Windows applications. To allow users to interact with images through a Windows application, add a WorkspaceViewer control to the form. As the user interacts with the image—moving the mouse, clicking on the image, defining a region on the image, and so forth—the control raises corresponding events. Images can be displayed in a Web application using either ASP.NET's built-in Image control or DotImage's WebImageViewer control. In addition to displaying images, the WebImageViewer can also create a rich image editing interface that utilizes AJAX techniques to efficiently communicate with the Web server when opening, saving, and manipulating images.
DotImage Photo Pro works with a variety of popular image codecs (JPEG, PNG, BMP, TIFF, GIF, PCX, and PSD, to name a few). The API was designed with extensibility in mind and allows custom encoders and decoders to be created and plugged in at runtime. There are also add-ons that can be purchased from Atalasoft's Web site that add features such as barcode recognition, optical character recognition, and advanced photo effects.
Price: $999 per developer license.
DotImage Poto Pro Offers a Robust Imaging API  (Click the image for a larger view)

The Bookshelf
In my job as a consultant and trainer I frequently meet with companies whose existing line-of-business application is unable to meet their current needs. In some cases it's because the application is not scaling; in others, the company is extending its products or services and needs to update the application to address these new offerings. These meetings usually leave me amazed at just how easy it is to create databases and data-driven applications with Microsoft's developer tools.
The scalability, extensibility, and maintainability of a database are directly related to the quality of its design. As such, it is important that the developers creating the data model for a data-driven application have a solid understanding of the principles of good design. Pro SQL Server 2005 Database Design and Optimization, by Louis Davidson, Kevin Kline, and Kurt Windisch (Apress, 2006), introduces readers to these principles and illustrates how to implement them in SQL Server™ 2005. The first half of the book explores database design concepts such as entities, relations, data integrity, and constraints.
The book's second half looks at database design outside of the data model. Chapter seven, for example, examines security topics such as authentication, permissions, encryption, and auditing. Other chapters focus on query optimization and index creation and usage. I found the chapter on code-level architectural decisions to be the most interesting, as it included discussions on ad hoc SQL queries versus stored procedures and choosing between T-SQL and CLR database objects.
Database design is vital to creating a data-driven application. Regardless of your expertise, I am confident that Pro SQL Server 2005 Database Design and Optimization will help improve your database design skills and applications.
Price: $59.99.
  

Send your questions and comments for Scott to toolsmm@microsoft.com.


Scott Mitchell, author of numerous books and founder of 4GuysFromRolla.com, is an MVP who has been working with Microsoft Web technologies since 1998. Scott is an independent consultant, trainer, and writer. Reach him at Mitchell@4guysfromrolla.com or via his blog at ScottOnWriting.NET.

All prices were confirmed at press time and are subject to change. The opinions expressed in this column are solely those of the author and do not necessarily reflect the opinions of Microsoft.

MSDN Magazine does not make any representation or warranty, express or implied with respect to any code or other information herein. MSDN Magazine disclaims any liability whatsoever for any use of such code or other information.
Page view tracker