Wednesday 5 October 2011

Client-Side Programming


At the same time that server-side web development was moving through an alphabet
soup of technologies, a new type of programming was gaining popularity. Developers
began to experiment with the different ways they could enhance web pages by embedding
multimedia and miniature applets built with JavaScript, DHTML (Dynamic HTML),
and Java code. These client-side technologies don’t involve any server processing.
Instead, the complete application is downloaded to the client browser, which executes it
locally.

The greatest problem with client-side technologies is that they aren’t supported
equally by all browsers and operating systems. One of the reasons that web development
is so popular in the first place is because web applications don’t require setup CDs, downloads,
and other tedious (and error-prone) deployment steps. Instead, a web application
can be used on any computer that has Internet access. But when developers use clientside
technologies, they encounter a few familiar headaches. Suddenly, cross-browser
compatibility becomes a problem. Developers are forced to test their websites with different
operating systems and browsers, and they might even need to distribute browser
updates to their clients. In other words, the client-side model sacrifices some of the most
important benefits of web development.

For that reason, ASP.NET is designed as a server-side technology. All ASP.NET code
executes on the server. When the code is finished executing, the user receives an ordinary
HTML page, which can be viewed in any browser.

Server-Side Programming


To understand why ASP.NET was created, it helps to understand the problems of other
web development technologies. With the original CGI standard, for example, the web
server must launch a completely separate instance of the application for each web
request. If the website is popular, the web server must struggle under the weight of hundreds
of separate copies of the application, eventually becoming a victim of its own
success.

To counter this problem, Microsoft developed ISAPI (Internet Server Application
Programming Interface), a higher-level programming model. ISAPI solved the performance
problem but at the cost of significant complexity. Even after ISAPI developers
master the tricky C++ programming language, they still lie awake at night worrying about
confounding issues such as multithreading. ISAPI programming is definitely not for the
fainthearted.

ISAPI never really went away. Instead, Microsoft used it to build higher-level development
platforms, such as ASP and ASP.NET. Both of these technologies allow developers
to program dynamic web pages without worrying about the low-level implementation
details. For that reason, both platforms have become incredibly successful. The original
ASP platform garnered a huge audience of nearly one million developers. When ASP.NET
was first released, it generated even more interest as the centerpiece of the .NET Framework.
In fact, ASP.NET 1.0 was enthusiastically put to work in dozens of large-scale
commercial websites even when it was only in late beta.


Despite having similar underpinnings, ASP and ASP.NET are radically different. ASP is
a script-based programming language that requires a thorough understanding of HTML
and a good deal of painful coding. ASP.NET, on the other hand, is an object-oriented programming
model that lets you put together a web page as easily as you would build a
Windows application. In many respects, it’s easier to learn ASP.NET than to master ASP,
even though ASP.NET is far more powerful.

Wednesday 24 August 2011

What Is HTML?


HTML is a markup language, although the original intent was to create a content description language.
It contains commands that, like a word processor, tell the computer— in a very loose sense— what the content of the document is. For example, using HTML, you can tell the computer that a document contains a paragraph, a bulleted list, a table, or an image. The HTML rendering engine is responsible for actually displaying the text and images on the screen. The difference between HTML and word processors is that word processors work with proprietary formats. Because they're proprietary, one word processor usually can't read another word processor's native file format directly. Instead, word processors use special programs called import/export filters to translate one file format to another. In contrast, HTML is an open, worldwide standard. If you create a file using the commands available in version 3.2, it can be displayed on almost any browser running on almost any computer with any operating system— anywhere in the world. The latest version of HTML, version 4.0, works on about 90 percent of the browsers currently in use.
HTML is a small subset of a much more full-featured markup language called Standard Generalized Markup Language (SGML). SGML has been under development for about 15 years and contains many desirable features that HTML lacks, but it is also complex to implement. This complexity makes it both difficult to create and difficult to display properly. HTML was developed as an SGML subset to provide a lightweight standard for displaying text and images over a slow dial-up connection— the World Wide Web. Originally, HTML had very few features it has grown considerably in the past few years. Nevertheless, you can still learn the core command set for HTML in just a few hours.
HTML contains only two kinds of information: markup, which consists of all the text contained between
angle brackets (<>), and content, which is all the text not contained between angle brackets. The difference between the two is that browsers don't display markup; instead, markup contains the information that tells the browser how to display the content.
For example, this HTML:
<html>
<head><title></title></head>
<body>
</body>
</html>
is a perfectly valid HTML file. You can save that set of commands as a file, navigate to it in your browser, and display the file without errors— but you won't see anything, because the file doesn't contain any content. All the text in the file is markup.
In contrast, a file with the following content contains no markup: This is a file with no markup
Although most browsers will display the contents of a file with no markup, it is not a valid HTML file. The individual parts of the markup between the brackets are tags, sometimes called commands. There are two types of tags— start tags and end tags, and they usually appear in pairs (although they may be widely separated in the file). The single difference is that the end tag begins with a forward slash, for instance </html>. Other than the forward slash, start tags and end tags are identical.