Tuesday, October 8, 2013

What is ASP .NET?

ASP .NET is a sophisticated and powerful web development framework. If you’ve never used ASP .NET before, it will likely take you some time and patience to grow accustomed to it. Development with ASP .NET requires not only an understanding of HTML and web design, but also a firm grasp of the concepts of object oriented programming and development.

ASP.NET is a server -side technology for developing web applications based on the Microsoft .NET Framework. Okay, let’s break that jargon-filled sentence down.

ASP .NET is a server -side technology. That is, it runs on the web server. Most web designers cut their teeth learning client-side technologies such as HTML, JavaScript, and Cascading Style Sheets (CSS) . When a web browser requests a web page created with only client-side technologies, the web server simply grabs the files that the browser (or client) requests and sends them down the line. The client is entirely responsible for reading the markup in those files and interpreting that markup to display the page on the screen.

ASP.NET is a technology for developing web applications. A web application is just a fancy name for a dynamic web site. Web applications usually (but not always) store information in a database, and allow visitors to the site to access and change that information. Many different programming technologies and supported languages have been developed to create web applications; PHP, JSP, Ruby on Rails, CGI, and ColdFusion are just a few of the more popular ones.

ASP.NET uses the Microsoft .NET Framework.The .NET Framework collects all the technologies needed for building Windows desktop applications, web applications, web services, and so on, into a single package, and makes them available to more than 40 programming languages.



FEATURES OF ASP.NET

  • ASP .NET lets you write the server -side code using your favorite programming  language or at least one the one you prefer from the long list of supported languages. The .NET Framework currently supports over 40 languages, and many of these may be used to build ASP .NET web sites. The most popular choices are C#
    (pronounced “ C sharp ” ) and Visual Basic (or VB),

  • ASP .NET pages are compiled, not interpreted. In ASP.NET’s predecessor , ASP, pages were interpreted: every time a user requested a page, the server would read the page’s code into memory, figure out how to execute the code, and execute it. In ASP .NET, the server need only figure out how to execute the code once.The code is compiled into efficient binary files, which can be run very quickly , again and again, without the overhead involved in rereading the page each time. This allows a big jump in performance, compared to the old days of ASP.

  • ASP .NET has full access to the functionality of the .NET Framework. Support for XML, web services, database interaction, email, regular expressions, and many other technologies are built right into .NET , which saves you from having to reinvent the wheel.

  • ASP .NET allows you to separate the server-side code in your pages from the HTML layout . When you’re working with a team composed of programmers and design specialists, this separation is a great help, as it lets programmers modify the server-side code without stepping on the designers’ carefully crafted HTML
    and vice versa.
 
  •  ASP .NET makes it easy to reuse common User Interface elements in many web forms, as it allows us to save those components as independent web user controls.

 REQUIRED SOFTWARE FOR ASP.NET


Visual Web Developer 2008 Express Edition

Visual Web Developer 2008 is a free, powerful web development environment for ASP .NET 3.5. It includes features such as a powerful code, HTML and CSS editor, project debugging, IntelliSense (Microsoft’s code auto completion technology), database integration with the ability to design databases and data structures visually , and much more.

.NET Framework 3.5 and the .NET Framework Software Development Kit (SDK)

As we’ve already discussed, the .NET Framework drives ASP.NET. You’re likely to have the .NET Framework already, as installs automatically through the Windows Update service. Otherwise, it’ll be installed together with Visual Web Developer

Microsoft SQL Server 2005 Express Edition

This is the free, but still fully functional, version of SQL Server 2005. This software is a Relational Database Management System whose purpose is to store, manage, and retrieve data as quickly and reliably as possible.

SQL Server Management Studio Express

Because the Express Edition of SQL Server doesn’t ship with any visual management tools, you can use this free tool, also developed by Microsoft, to access your SQL Server 2005 database.


An ASP.NET page consists of the following elements:

  • directives
  • code declaration blocks
  • code render blocks
  • ASP .NET server controls
  • server-side comments
  • literal text and HTML tags


Directives

The directives section is one of the most important parts of an ASP .NET page. Directives control how a page is compiled, specify how a page is cached by web browsers, aid debugging (error fixing), and allow you to import classes to use within your page’s code. Each directive starts with <%@ . This is followed by the directive name, plus any attributes and their corresponding values. The directive then ends with %>

Code Render Blocks

You can use code render blocks to define inline code or expressions that will execute when a page is rendered. Code within a code render block is executed immediately when it is encountered during page rendering. On the other hand, code within a code declaration block (within <script> tags) is executed only when it is called or triggered by user or page interactions. There are two types of code render blocks inline code, and inline expressions both of which are typically written
within the body of the ASP.NET page.


ASP.NET Server Controls

At the heart of any ASP .NET page lie server controls, which represent dynamic elements with which your users can interact. There are three basic types of server control: ASP .NET controls, HTML controls, and web user controls. Usually , an ASP.NET control must reside within a <form runat="server"> tag in
order to function correctly.

Controls offer the following advantages to ASP .NET developers:

They give us the ability to access HTML elements easily from within our code:we can change these elements’
characteristics, check their values, or even update them dynamically from our server-side programming language of choice.

With ASP.NET controls, developers are able to separate a page’s presentational elements (everything the user sees) from its application logic (the dynamic portions of the ASP.NET page), so that each can be maintained separately.


Many ASP.NET controls can be “ bound” to the data sources from which they will extract data for display with minimal (if any) coding effort.

Server-side Comments

Server-side comments allow you to include within the page comments or notes that
won’t be processed by ASP .NET. Traditional HTML uses the <!-- and --> character sequences to delimit comments; any information included between these tags won’t be displayed to the user . ASP .NET comments look very similar , but use the sequences <%-- and --%>

Working with Directives

Three of the most commonly used directives are:

Page
This directive defines page-specific attributes for the ASP .NET page, such as the language used for server
-side code. We’ve already seen this directive in use.

Import
The Import directive makes functionality that’s been defined elsewhere available in a given page. The following example, for instance, imports functionality from the System.Web.Mail namespace, which you could use to send email from a page.