Dan Maharry

Three Changes of Behaviour in AJAX Control Toolkit v40412

by

The interesting thing about writing a book such as Programming ASP.NET 3.5 is that as new readers come to it over time, they find that libraries used within the book code break the examples. Peter Ormshaw got in touch today to point out that the Ajax Control Toolkit has changed slightly since build 20229 which the book was built against.

In particular, he’s come across three differences between the book and working with v3.5.40412 which is the latest version at the moment.

Installing The Control Toolkit

Appendix A, which covers installing the control toolkit is now obsolete. Best practice now would be to download the binaries for the toolkit and follow the installation instructions at http://www.asp.net/ajaxlibrary/act.ashx.

You Must Use The Toolkit Script Manager

Any AJAX web form you’ve created in Visual Studio automatically contains the standard ASP.NET ScriptManager control. If you want to use any toolkit controls on that page, you must replace this with the toolkit’s own ScriptManager control. So then, you change this

<asp:ScriptManager ID="ScriptManager1" runat="server" />

to this

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>

Toolkit now uses asp as its TagPrefix: BulletedList Users Beware!

The final thing to note is that v40412 now has the Toolkit controls use “asp” as the default TagPrefix for its controls rather than cc1. This in itself is not a problem and makes sense as Microsoft have now more formally adopted the Toolkit with all its jQuery finery and finessing on the client side.

However, the toolkit also includes a control called BulletedList which, with the tagprefix change now means that Visual Studio will no longer compile pages referencing the toolkit and containing this control until you alter the TagPrefix used by the toolkit on that page. Typically, that means changing the “asp” in TagPrefix=”asp” in this line

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

to something other than asp. Don Kiely has a full description and reasoning behind this issue at devproconnections.com.

Programming ASP.NET 3.5 Details and Downloads

by

Programming ASP35CoverReleased in October 2008, Programming ASP.NET 3.5 is the result of 13 months writing, editing and researching all the great new things you can produce with ASP.NET 3.5. Weighing in at 1166 pages, it’s not the smallest book around but it is the best and I’m very proud of it.

New to this (fourth) edition of the book are sections on LINQ, web services using WCF, ASP.NET AJAX and the AJAX control toolkit, HTTP Handlers, Web Application and Deployment Projects, HistoryState, IIS 7.0 and much much more.

Download the code samples for this book in C# (544KB)
Download the code samples for this book in VB (535KB)
Download a draft of Chapter 7 : Data Source Controls and Connections (PDF, 1.6 MB)
Download a draft of Chapter 10 : LINQ (PDF, 1.3 MB)
Download a draft of Chapter 16 : Web Services (PDF, 1.3 MB)

Buy Programming ASP.NET 3.5 on Amazon UK  Buy Programming ASP.NET 3.5 on Amazon US

Here’s the full table of contents:

  1. Web Development in 2008
  2. Visual Studio 2008
  3. Controls: Fundamental Concepts
  4. Basic Server Controls
  5. Advanced Server Controls
  6. Website Fundamentals
  7. Data Source Controls and Connections
  8. Using Data-Aware Controls
  9. ADO.NET
  10. Presenting LINQ
  11. Validation
  12. Forms-Based Security
  13. Master Pages and Navigation
  14. Personalization
  15. Custom and User Controls
  16. Web Services
  17. Caching and Performance
  18. Application Logic, Configuration and IIS 7.0
  19. Tracing, Debugging and Error Handling
  20. Deployment
  21. From now to vNext
  22. Installing the AJAX Control Toolkit
  23. Relational Databases: A Crash Course
  24. VS2008 Keyboard Shortcuts

O’Reilly’s official forum for the book.

O’Reilly’s official page for the book. Please use this link to submit any errata for this book.

Programming ASP.NET 3.5 Is Slated For PDC

by

Well, it’s been a while coming but it looks like Programming ASP.NET 3.5 will finally hit the shelves in late October just in time for this year’s PDC. Hurrah! So, to take a leaf out of John Papa’s blog, it’s time to take a few seconds out and thank those who were involved in its creation.

First off, my co-authors Jesse Liberty and Dan Hurwitz for their support and words. And to Lou Franco and Mike Pope as well for their contributions to the book. They were both timely and well received by those of us all worded out.

Second, to the reviewing team for the necessary evil of reminding the authors that their words are not the be all and end all of the subject and should never treat them as such. Especially when trying to incorporate ever-changing technology into a set of static pages. So, to Don Kiely, Eugene Osovetsky, Frank Wang, Scott Isaacs, Christy Henriksson, Kyle Beyer, and Miles Whitener my humble thanks, even if some of your comments made me want to throw the laptop in the bin because I knew you were right and it would mean writing another five or ten pages to cover the point. Lou Franco and Mike Pope also get a second vote of thanks here because they not only provided really solid comments, they also decided to back their own comments up with words.

Next, thanks to the folks at O’Reilly. Lou Barr initially mentioned me to John Osborn as a potential co-author, so I thank her for the mention and John for getting in touch and then letting me get on with it at a pace I could manage. Brian MacDonald, Audrey Doyle and Rachel Monaghan have also been great as technical, copy and production editors respectively. I hope I’ll work with them again (preferable on something smaller).

And finally, thanks to Jane for putting up with about thirteen or so months of the book-writing process.

Programming ASP.NET 3.5 is already up for pre-order on Amazon US and Amazon UK. Why not buy a copy?

Adios EnableStateHash, Hello EnableSecureHistoryState

by

Just a quick note on the new Browser History feature in .NET 3.5 SP1. I had some time to experiment with beta 1. Because of its long gestation period as part of the ASP Futures package, it has been written about a lot. However, as is the curse of beta software, there is a ‘breaking change’ between the beta 1 release and the futures package version that many blog articles write about.

The feature is still enabled using the EnableHistory attribute on your page’s ScriptManager object.

<asp:ScriptManager runat="server" id="sm1" EnableHistory="true" /> 

However, the EnableStateHash attribute which you can use to have ASP.NET encrypt or not encrypt the page state in its querystring has been renamed. It is now called EnableSecureHistoryState.