Chapter 11. IronPython and ASP.NET

 

This chapter covers

  • ASP.NET concepts
  • Building a web-based document editor
  • Handling view state
  • Creating reusable controls

So far we’ve been focusing on using IronPython with Windows Forms to construct rich desktop applications, but the .NET platform also provides a high-level framework for building web applications: ASP.NET.

ASP.NET includes lots of goodies for web development. It provides a powerful page model where server-to-client round-tripping of data is handled automatically, removing the need for a lot of the boilerplate code in a web application. The .NET class library has a huge range of classes for solving different problems, and ASP.NET also comes with a large number of its own built-in components for user interfaces. The end result is that ASP.NET can help you write web applications faster and with less code—and it can do this even better once we add Python to the mix!

The IronPython team has released a project enabling the use of IronPython within ASP.NET. In this chapter we use it to build a simple application to display a MultiDoc file in a web page, and then extend it to allow you to edit the file over the web. Finally you’ll see how you can package up things we’ve built as controls that can be used in other web pages. Before taking a closer look at the IronPython integration, though, let’s get an overview of the framework itself.

11.1. Introducing ASP.NET

11.2. Adding IronPython to ASP.NET

11.3. ASP.NET infrastructure

11.4. A web-based MultiDoc Viewer

11.5. Editing MultiDocs

11.6. Converting the Editor into a user control

11.7. Summary