Brian Mains

Catch me on linked in at: http://linkedin.com/in/brianmains, or follow me on twitter at: @brianmains.

March 2009 - Posts

RadNumericTextBox Number Formatting Issues

I found something out with the RadNumericTextBox control: for the GroupSeparator, it will accept an empty string, but not for the DecimalSeparator property.  This is important, as the RadNumericTextBox behaves in a certain way.  If you try to set:

<tel:RadNumericTextBox ..>
    <NumberFormat DecimalDigits="0" DecimalSeparator="" />
</tel:RadNumericTextBox>

An exception is thrown for this, but

<tel:RadNumericTextBox ..>
    <NumberFormat DecimalDigits="0" GroupSeparator="" />
</tel:RadNumericTextBox>

will not throw an exception.

Let's say you are using this control for the zip code.  The side effect of not specifying an empty group separator is that it will insert a comma every three places, and create a number like 90,210, whereas specifying an empty string will yield 90210.  Also, setting DecimalDigits to zero prevents using the decimal anyway.

For amounts, set the DecimalDigits to 2, and the DecimalSeparator defaults to period (at least for en-US culture), and comma (for en-US culture) every three spaces.

Book Review: Pro ASP.NET 3.5 AJAX from Wrox

There are quite a bit of books on the market about ASP.NET and AJAX.  The book “Professional ASP.NET AJAX” from Wrox is a good overview of the AJAX framework.  The authors of the book cover a wide array of subjects that you don’t find in every AJAX book.  The book covers topics like localization and globalization, custom AJAX controls, web services, the WebRequest object, AjaxControlToolkit overview, and more.

As a professional series book, the book does cover a good amount of material to deserve the label.  After introducing the reader with the basics, the book moves into the ScriptManager control and all it has to offer, including the new script combining feature.  This is followed by a chapter on the back button, history points, and partial updates features.

The book covers AJAX networking and using the WebRequest object and its ability to request information from the server, which has the ability to contact the server and receive the updated HTML as a response.  This chapter surprisingly didn’t cover web services, but an adjacent chapter covers the in-built application and profile services that allow profiling and login/logout functionality all in client script.  The book continues to cover state management; error handling and Sys.Debug; and deployment of AJAX-enabled applications.  For deployment, there was a lot of information that’s important to know about deploying an application I never knew about.

The book covers customization; it features developing a custom AJAX control that changes its content on the client-side, along with an AJAX extender using the AJAX Control Toolkit.  The book looks at the basics of these, as the development approaches vary significantly.  The subsequent chapter focuses on embedding AJAX code into web parts using the existing web part framework.

Overall, the book is well-written and conveys its points clearly.  I think some of the content is organized in an awkward way; for instance, the book briefly looks at localization early in the book with a good explanation, then features a full chapter later in the book.  It felt like it was repeating itself in a few places.  The chapters are written fluently; the reading of the book isn’t dry at all, which makes for a good tech book.

Posted: Sun, Mar 8 2009 14:43 by bmains | with 1 comment(s)
Filed under: