15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

40<br />

Core asP.neT<br />

WhaT ’ s in This ChaPTer<br />

➤<br />

➤<br />

➤<br />

➤<br />

Introduction to ASP.<strong>NET</strong><br />

Creating ASP.<strong>NET</strong> Web Forms<br />

Binding data with ADO.<strong>NET</strong><br />

Confi guring applications<br />

If you are new to the world of <strong>C#</strong> <strong>and</strong> .<strong>NET</strong>, you might wonder why a chapter on ASP.<strong>NET</strong> has been<br />

included in this book. It ’ s a whole new language, right Well, not really. In fact, as you will see, you<br />

can use <strong>C#</strong> to create ASP.<strong>NET</strong> pages.<br />

ASP.<strong>NET</strong> is part of the .<strong>NET</strong> Framework <strong>and</strong> is a technology that allows for the dynamic creation<br />

of documents on a web server when they are requested via HTTP. This mostly means HTML <strong>and</strong><br />

XHTML documents, although it is equally possible to create XML documents, cascading style sheet<br />

(CSS) fi les, images, PDF documents, or anything else that supports MIME types.<br />

In some ways, ASP.<strong>NET</strong> is similar to many other technologies — such as PHP, ASP, or ColdFusion.<br />

There is, however, one key difference: ASP.<strong>NET</strong>, as its name suggests, has been designed to be fully<br />

integrated with the .<strong>NET</strong> Framework, part of which includes support for <strong>C#</strong>.<br />

Perhaps you are familiar with Active Server Pages (ASP) technology, which enables you to create<br />

dynamic content. If you are, you will probably know that programming in this technology used<br />

scripting languages such as VBScript or JScript. The result was not always perfect, at least not for<br />

those of us used to “ proper, ” compiled programming languages, <strong>and</strong> it certainly resulted in a loss<br />

of performance.<br />

One major difference related to the use of more advanced programming languages is the provision of<br />

a complete server - side object model for use at runtime. ASP.<strong>NET</strong> provides access to all the controls<br />

on a page as objects, in a rich environment. On the server side, you also have access to other .<strong>NET</strong><br />

classes, allowing for the integration of many useful services. Controls used on a page expose a lot<br />

of functionality; in fact, you can do almost as much as with Windows Forms classes, which provide<br />

plenty of fl exibility. For this reason, ASP.<strong>NET</strong> pages that generate HTML content are often called<br />

Web Forms.<br />

This chapter takes a more detailed look at ASP.<strong>NET</strong>, including how it works, what you can do with it,<br />

<strong>and</strong> how <strong>C#</strong> fi ts in.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!