Ext.NET Web Application Development A guide to building Rich Internet Applications with Ext.NET using ASP.NET Web Forms and ASP.NET MVC Anup Shah BIRMINGHAM - MUMBAI Ext.NET Web Application Development Copyright © 2012 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: November 2012 Production Reference: 1121112 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84969-324-0 www.packtpub.com Cover Image by Geoffrey McGill ([email protected]) Credits Author Project Coordinator Anup Shah Vishal Bodwani Reviewers Proofreaders Geoffrey McGill Clyde Jenkins Daniil Veriga Linda Morris Vladmir Shcheglov Indexer Tejal Soni Acquisition Editor Usha Iyer Graphics Aditi Gajjar Lead Technical Editor Kedar Bhat Production Coordinator Nilesh R. Mohite Technical Editors Vrinda Amberkar Devdutt Kulkarni Cover Work Nilesh R. Mohite Worrell Lewis About the Author Anup Shah has been a professional software and web developer since 1997. After graduating from Manchester University with a First Class Honors degree in Computing and Information Systems, he got a job in the United States. There, he soon headed the web development for a rapidly growing dot com, experiencing both the highs and lows of the first dot com bubble. After a number of years there he moved back to England where he grew up and joined a small dynamic software company working as a consultant, architect, and web developer for some high profile retail e-commerce websites, including some of the world's largest. Around 2007, while at the same company, he changed focus from a consulting role to a product development role, responsible for the user interface of a complex retail web application product. It was at this time he came across Ext.NET (or Coolite as it was known back then) and rapidly adopted it and introduced it into the company's product. Anup can be found on the Ext.NET forums, and contacted via his blog, http://www.onenaught.com. I would like to thank a number of people for their direct or indirect role in producing this book. First, there is my wife Kajal, without whom none of this would be possible. Her support has been second to none, especially after what she has endured this year. Thank you. I also wish to thank my work colleagues—past and present—for their support and encouragement in various ways over the years (I dare not list names as I will certainly miss some out but you know who you are!) I must also thank all at Packt for giving me this opportunity, as well as having patience and understanding during some difficult times. And, of course, there is the Ext.NET team. They have not only created an amazing framework (that stopped me quitting ASP.NET development altogether!) but their professionalism, dedication, and support has been amazing and I have learned a lot both professionally and personally along the way. Geoffrey, Daniil, Vladimir: This book would not be possible without you. Finally, I dedicate this book to the loving memory of my baby twins, Preetam and Bhaav. About the Reviewers Geoffrey McGill is the founder of Ext.NET and a 10+ year veteran of ASP.NET, C#, and JavaScript development. Geoffrey is responsible for overseeing the technical and strategic direction of Ext.NET. As an early adopter of Ext JS (originally yui-ext), the benefit to ASP.NET developers was obvious, although how to integrate into the ASP.NET life cycle was not. This is where the idea for Ext.NET was born. As a passionate advocate for free and open-source software, Geoffrey has contributed code to many projects, including as the creator of DateJS (http://datejs.com/) which has been downloaded more than 2,000,000 times. Daniil Veriga was born in 1985. As a young man, he enjoyed programming and won prizes in school competitions on programming. His interest in programming predetermined his path. He graduated from the Department of Computer Systems and Programming of the Saint-Petersburg State University Of Aerospace Instrumentation with honors. He started his career as a Software Engineer in a company developing industrial automation systems. He got great experience designing and implementing high performance real-time systems and solving challenging tasks. But later, he got interested in web technologies and was eventually hired to work for Ext.NET in 2010. His main skills and experience are C#, .NET, ASP. NET, ASP.NET MVC (Web Form and Razor engines), SQL, Visual Studio, JavaScript, HTML, CSS, ExtJS, and (obviously) Ext.NET, which this book is about. In his spare time, Daniil likes reading, swimming, skiing, biking, exercising on horizontal bars, and arm-wrestling. First of all I would like to thank my chiefs and colleagues – Geoffrey McGill and Vladimir Shcheglov, as well as my brother – Leonid Veriga. They truly helped my professional development in the programming and web technologies area. Also, I thank my family and all my friends. All of them made a certain contribution to my professional growth! And, finally, I thank Anup Shah for his efforts to write this book and, respectively, for popularizing Ext.NET. I think we all did a good job! Vladimir Shcheglov graduated from Saint-Petersburg State University of Aerospace Instrumentation with a Master's degree in Computer Science. He began his IT career as a Delphi developer (industrial control). Since 2005, he has been a C#/ASP.NET developer. Vladimir started to learn ExtJS from Version 1.1 and tried using it in an ASP.NET context. He received an invite to participate in the Coolite framework (former name of Ext.Net) development after creating and sharing the first prototype of Visual Studio designers and ASP.NET controls. Vladimir is the lead Software Engineer on the Ext.NET team. www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Table of Contents Preface 1 Getting Started with Ext.NET 7 An overview of Ext.NET 7 Ext.NET and its relationship with ASP.NET Web Forms and ASP.NET MVC 8 Ext JS 8 Comparing with other JavaScript libraries such as jQuery 8 From a web developer's point of view 9 Ext.NET from an ASP.NET application developer's point of view 10 Ext.NET and Ext JS versions 11 Prerequisites 12 When to use ExtJS/Ext.NET and when not to 13 Getting Ext.NET 13 Choosing the right Ext.NET license 13 Downloading Ext.NET 14 Compiling (if needed) 15 A walkthrough – creating a simple ASP.NET project with Ext.NET enabled 15 Creating the project and enabling Ext.NET 16 Running the sample Ext.NET page 16 What the sample page does 17 Ext.NET in the ASP.NET project 20 Ext.NET and Web.config 20 Ext.NET controls are registered in Web.config for you 22 A walkthrough – creating a simple ASP.NET MVC Project with Razor and Ext.NET enabled 23 Creating an MVC project and enabling Ext.NET 23 The sample Ext.NET page using MVC and Razor 23 Summary 26
Description: