CodeNotes provides the most succinct, accurate, and speedy way for
a developer to ramp up on a new technology or language.
Unlike other programming books, CodeNotes drills down to
the core aspects of a technology, focusing on the key elements needed in order to implement it immediately. It is a unique resource for
developers, filling the gap between comprehensive manuals and
pocket references.
CodeNotes for ASP.NET is a revolutionary update to Microsoft’s Active Server Pages. This edition explores how Web applications and Web services can be developed using ASP.NET. The .NET architecture, Base Class Libraries, ASP.NET form designer,
Web controls, and cross-page and cross-language debugging
are discussed. Scaling ASP.NET to multiple servers,
state management, security, and methods of enhancing performance are also covered.
This edition of CodeNotes includes:
• Real-world examples
• “How and Why” and “Bugs and Caveats” sections that provide
workarounds and tips on what should be taken advantage
of or avoided
• “Design Notes” illustrating many of the common use patterns for
Java programs
• Instructions and classroom-style tutorials throughout from experts
Visit www.codenotes.com for updates, source code templates, access to
message boards, and discussion of specific problems with
CodeNotes authors and other developers.
Join our nonfiction newsletter by sending a blank e-mail to:
join-rht-nonfiction@list.randomhouse.com or visit www.atrandom.com
Every CodeNotes title is written and reviewed by a team of commercial software developers and technology experts. See “About the Authors” at the front of the book for more information.
Die Inhaltsangabe kann sich auf eine andere Ausgabe dieses Titels beziehen.
Gregory Brill is the series editor of CodeNotes and the founder and president of Infusion Development Corporation, a technology training and consulting firm that specializes in architecting securities trading and analytic systems for several of the world’s largest investment banks. He has written for C++ Users Journal, and is the author of Applying COM+. He lives in New York.
ovides the most succinct, accurate, and speedy way for
a developer to ramp up on a new technology or language.
Unlike other programming books, CodeNotes drills down to
the core aspects of a technology, focusing on the key elements needed in order to implement it immediately. It is a unique resource for
developers, filling the gap between comprehensive manuals and
pocket references.
CodeNotes for ASP.NET is a revolutionary update to Microsoft s Active Server Pages. This edition explores how Web applications and Web services can be developed using ASP.NET. The .NET architecture, Base Class Libraries, ASP.NET form designer,
Web controls, and cross-page and cross-language debugging
are discussed. Scaling ASP.NET to multiple servers,
state management, security, and methods of enhancing performance are also covered.
This edition of CodeNotes includes:
Real-world examples
How and Why a
Chapter 1
INTRODUCTION ASP.NET is Microsoft’s new technology for developing web-based applications. The most significant feature of ASP.NET (formerly named ASP+) is that it allows you to develop web applications using the intuitive drag-and-drop methodology that made Visual Basic popular. Simply “paint” your application within an intuitive development environment, and it will look and behave identically when deployed on a client’s browser. In addition to this noteworthy capability, ASP.NET boasts a number of improvements over the traditional Active Server Page (ASP) technology that you may be using today. These improvements, which we will examine throughout this book, are listed below.
STRONGLY TYPED AND COMPILED LANGUAGES
The languages used to write traditional ASP applications (VBScript and JScript) have two primary limitations. First, they are inherently typeless, meaning that they have no concept of variable types. For example, in VBScript all variables are implicitly Variants—there is no way to declare a variable as a more specific Integer or String. Second, these languages are interpreted, meaning that ASP translates an application’s source on a line-by-line basis. If the fiftieth line of the application contains a syntax error, ASP must process the first forty-nine lines before the error will be detected.
With ASP.NET, applications are developed using strongly typed languages such as Visual Basic, C++, JScript.NET, or Microsoft’s new language, C# (pronounced “C-sharp”). Furthermore, applications in ASP.NET are compiled, which means that the entire source file is quickly examined and converted into machine code before the application is executed. Compiled applications are not only significantly faster than their interpreted counterparts, they are also easier to debug since syntax errors can be caught at compile time (while you are developing), as opposed to runtime (when the application executes).
SEPARATION OF CODE FROM CONTENT
Another cumbersome aspect of ASP development is the interspersion of source code with HTML. Because ASP scripts contain both code and HTML, source files are often lengthy, difficult to read, and hard to debug. The intermixing of HTML with ASP code is particularly problematic for larger web applications, where content must be kept separate from business logic.
ASP.NET eliminates this problem by keeping the design and programmatic aspects of your application separate. One file contains the application’s design (the HTML), whereas another file, called the CodeBehind file, houses its associated logic (the source code). Thus, developers can work on the application’s code while designers and graphic artists independently work on its content.
BROWSER NEUTRALITY
Supporting multiple browsers is a recurrent and persistent problem when developing web applications. ASP.NET eliminates this concern through its Web Control technology. A Web Control is a graphical entity very similar to an intrinsic control found in Visual Basic 6 (such as a Textbox or Button). Like its Visual Basic counterpart, a Web Control exposes a rich event model that you program against (such as a TextChanged() event, which triggers when the contents of the control change).
What is important about Web Controls is that they reside entirely on the server and generate client-side and server-side code to render themselves appropriately in a browser. In the eyes of ASP.NET, a browser can be one of two types: An UpLevel browser, defined as Internet Explorer 4.0 or higher; or a DownLevel browser, defined as everything else (including all versions of Netscape).
If the browser is UpLevel, then the control generates client-side JavaScript so that events can be trapped directly on the client. If the browser is of the DownLevel type, then the control generates standard HTML, which requires a round-trip to the server to trigger events. We will examine Web Controls, and this seemingly unfair browser classification, in Chapter 5.
RICH DEVELOPMENT ENVIRONMENT
Microsoft’s new development environment, Visual Studio.NET (VS.NET), allows you to develop web applications as you do in Visual Basic 6—by dragging and dropping GUI elements onto a base form and then writing the logic behind the controls. In addition, Visual Studio.NET offers sophisticated debugging features such as breakpoints, variable inspection, compile-time error checking, and code-stepping capabilities.
VS.NET is the development environment not only for ASP.NET applications, but for all applications that leverage .NET technology (such as component libraries that your web applications might utilize). Such uniformity allows you to debug both ASP.NET applications and the components they call from the same environment. As we will illustrate in Chapter 6, you can, for example, “step” into a library component developed in C# from an ASP.NET application developed in Visual Basic. This is considerably more convenient than today’s setup, whereby you might be working with numerous develop environments: Visual InterDev for ASP code, the Visual Basic environment for VB components, and Visual Studio for C++ COM components.
DEPLOYMENT AND ROBUSTNESS
In addition to making web applications easier to develop, ASP.NET makes it easier to deploy and maintain them. Application configuration settings are stored in easily accessible XML files, as opposed to the IIS proprietary metabase that housed such information in traditional ASP. As you will see in Chapter 7, the ASP.NET engine is considerably more robust and manageable than its ASP predecessor, which allows one to store client session information in SQL Server, for example. The engine can also be “recycled” (restarted) when its memory usage reaches a prescribed limit, which offers greater reliability.
WHAT DOES ASP.NET MEAN TO ME?
The impact of ASP.NET on your development efforts largely depends upon your background.
If you are an ASP developer, you will be happy to learn that ASP.NET abstracts, to a large degree, the idiosyncrasies of the web with which you have had to familiarize yourself. Rather than worrying about concepts such as HTML tags, POST, GET, and Querystrings, you can concentrate on writing application code. This is not to say that ASP.NET renders your existing skill set obsolete; it simply takes care of many redundant details that you must manually code in ASP. You always have the option of overriding ASP.NET’s automation of these details whenever you wish. ASP developers will especially welcome the strongly typed languages that ASP.NET supports, as well as VS.NET’s intuitive design environment, which allows one to debug applications using features such as breakpoints and instant watches.
If you program primarily in Visual Basic, you can apply the design methodology you’ve used for years directly in ASP.NET—by dragging and dropping controls onto a form (a Web Form in ASP.NET) and then writing the logic behind them. ASP.NET exposes an event paradigm that Visual Basic developers will instantly recognize. For example, when a web page loads, it automatically invokes the Page_Load() method, similar to the Form_Load() method in Visual Basic. With ASP.NET, it is entirely possible to develop a web application without any knowledge of HTTP, HTML, or web design. Simply create your application in VS.NET and it will be rendered in a browser by the ASP.NET runtime.
If you come from the world of C++ or Java you will probably develop applications using either C# or J#. As we will see in this chapter’s Core Concepts section, C# (pronounced “C-sharp”) is similar to C++, whereas J# (J-sharp) is Microsoft’s conversion of the Java language to the .NET world. If you are familiar with...
„Über diesen Titel“ kann sich auf eine andere Ausgabe dieses Titels beziehen.
Anbieter: SuzyQBooks, Salt Lake City, UT, USA
Paperback. Zustand: Very Good. A few use marks. Pages clean. Bestandsnummer des Verkäufers 023677
Anzahl: 1 verfügbar