Thursday, 2 February 2012

Directives | ASP.Net Tutorial | ASP.Net Tutorial PDF

    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 %>.

     There are many directives that you can use within your pages, and we’ll discuss them in greater detail later. For the moment, however, know that the Import and Page directives are the most useful for ASP.NET development. Looking at our sample ASP.NET page, Hello.aspx, we can see that a Page directive was used at the top of the page like so:

Visual Basic                LearningASP\VB\Hello.aspx (excerpt)
<%@ Page Language="VB" %>

C#                              LearningASP\CS\Hello.aspx(excerpt)
<%@ Page Language="C#" %>
     In this case, the Pagedirective specifies the language that’s to be used for the application logic by setting the Language attribute. The value provided for this attribute, which appears in quotes, specifies that we’re using either VB or C#. A whole range of different directives is available; we’ll see a few more later in this chapter.
     ASP.NET directives can appear anywhere on a page, but they’re commonly included at its very beginning.

ASP.NET Page Structure | ASP.Net Tutorial | ASP.Net Tutorial PDF

  ASP.NET pages are simply text files that have the .aspx file name extension, and can be placed on any web server equipped with ASP.NET.
                     Figure : The life cycle of the ASP.NET page
      When a client requests an ASP.NET page, the web server passes the page to the ASP.NET runtime, a program that runs on the web server that’s responsible for reading the page and compiling it into a .NET class. This class is then used to produce the HTML that’s sent back to the user. Each subsequent request for this page avoids the compilation process: the .NET class can respond directly to the request, producing the page’s HTML and sending it to the client, until such time as the .aspx file changes. This process is illustrated in above Figure.
  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
   For the purpose of examining all the elements that can make up an ASP.NET page, we will not be using any code-behind files, as we did in Chapter 1. Code-behind files are useful at separating layout from code by breaking a web form into two files, but here all we’re interested in seeing is all the pieces of a web form in one place. This will make it easier to understand the structure of the web form.
   The code below represents a version of the page you wrote in Chapter 1, which does not use a code-behind file. You’ll notice the server-side script code now resides in a script element:

Visual Basic                  LearningASP\VB\Hello.aspx(excerpt)
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
myTimeLabel.Text = DateTime.Now.ToString()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Welcome to Build Your Own ASP.NET 3.5 Web Site!</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>Hello there!</p>
<p>
The time is now:
<%-- Display the current date and time --%>
<asp:Label ID="myTimeLabel" runat="server" />
</p>
<p>
<%-- Declare the title as string and set it --%>
<% Dim Title As String = "This is generated by a code
render block."%>
<%= Title %>
</p>
</div>
</form>
</body>
</html>
C#                        LearningASP\CS\Hello.aspx(excerpt)
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
myTimeLabel.Text = DateTime.Now.ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Welcome to Build Your Own ASP.NET 3.5 Web Site!</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>Hello there!</p>
<p>
The time is now:
<%-- Display the current date and time --%>
<asp:Label ID="myTimeLabel" runat="server" />
</p>
Build Your Own ASP.NET 3.5 Web Site Using C# & VB (www.sitepoint.com)
ASP.NET Basics 29
<p>
<%-- Declare the title as string and set it --%>
<% string Title = "This is generated by a code render block."; %>
<%= Title %>
</p>
</div>
</form>
</body>
</html>
   If you like, you can save this piece of code in a file named Hello.aspx within the LearningASP\CS or LearningASP\VB directory you created in Chapter 1. You can open a new file in Visual Web Developer by selecting Website > Add New Item…. Use a Web Form template, and, since we are not using a code-behind file for this example, you need to deselect the Place code in a separate file checkbox. Alternatively, you can copy the file from the source code archive.
     Executing the file (by hitting F5) should render the result shown in below Figure .
                     Figure : Sample page in action
  This ASP.NET page contains examples of all the above components (except server-side includes) that make up an ASP.NET page. You won’t often use every single element in a given page, but it’s important that you’re familiar with these elements, their purposes, and how and when it’s appropriate to use them.

ASP.NET Basics | ASP.Net Tutorial | ASP.Net Tutorial PDF

   So far, you’ve learned what ASP.NET is, and what it can do. You’ve installed the software you need to get going, and you even know how to create a simple ASP.NET page. Don’t worry if it all seems a little bewildering right now, because, as this book progresses, you’ll learn how easy it is to use ASP.NET at more advanced levels.
   As the next few chapters unfold, we’ll explore some more advanced topics, including the use of controls, and various programming techniques. But before you can begin to develop applications with ASP.NET, you’ll need to understand the inner workings of a typical ASP.NET page—with this knowledge, you’ll be able to identify the parts of the ASP.NET page referenced in the examples we’ll discuss throughout this book. So in this chapter, we’ll talk about some key mechanisms of an ASP.NET page, specifically:
  • page structure
  • view state
  • namespaces
  • directives
     We’ll also cover two of the “built-in” languages supported by the .NET Framework: VB and C#. As this section progresses, we’ll explore the differences and similarities between these two languages, and form a clear idea of the power that they provide for/ those creating ASP.NET applications.
    So, what exactly makes up an ASP.NET page? The next few sections will give you an in-depth understanding of the constructs of a typical ASP.NET page.

Wednesday, 1 February 2012

Writing Your First ASP.NET Page | ASP.Net Tutorial | ASP.Net Tutorial PDF

  For your first ASP.NET exercise, we’ll create the simple example shown in below Figure . We’ll go though the process of creating this page step by step.
              Figure : An exciting preview of your first ASP.NET page!

   To create this page in Visual Web Developer, you’ll need to follow a few simple steps:
1. Start Visual Web Developer, and choose File > New Web Site (or hit the default keyboard shortcut, Shift+Alt+N).
2. Choose ASP.NET Web Site for the template and File System for the location type. This location type tells Visual Web Developer to create the project in a physical folder on your disk, and execute that project using the integrated web server.
3. Choose the language in which you prefer to code your pages. Although ASP.NET allows you to code different pages inside a project in different languages, for the sake of simplicity we’ll generally assume you work with a single language.
4. If you chose C# for the language, type C:\LearningASP\CS\for the folder location where you want to store the files for this exercise. If you prefer VB.NET, choose C:\LearningASP\VB\. You can choose any location you like. Figure shows the C# version of the selection.
         Figure : Starting a new ASP.NET Web Site project with Visual Web Developer

              Figure : Your new project in Visual Web Developer

5. After clicking OK, Visual Web Developer will create the project with a basic structure. Your project contains an empty App_Data folder, a basic Default.aspx file, and a basic configuration file, Web.config—see above Figure We’ll discuss each of them in detail a bit later on, but right now, let’s dive in and create our first ASP.NET web page.
    The main panel in the Visual Web Developer interface is the page editor, in which you’ll see the HTML source of the Default.aspx web page. Edit the title of the page to something more specific than Untitled Page, such as Welcome to Build Your Own ASP.NET 3.5 Web Site!:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Welcome to Build Your Own ASP.NET 3.5 Web Site!
</title>
</head>
  Loading the Default.aspx page in a web browser now would open an empty page; this makes sense, since we didn’t add any content to this page! Let’s modify the page by adding the highlighted:
<body>
<form id="form1" runat="server">
<div>
<p>Hello there!</p>
<p>
The time is now:
<asp:Label ID="myTimeLabel" runat="server" />
</p>
</div>
</form>
</body>
</html>


  Although our little page isn’t yet finished (our work with the Label control isn’t over), let’s execute the page to ensure we’re on the right track. Hit F5 or go to Debug menu.

   The first time you do this, Visual Web Developer will let you know that your project isn’t configured for debugging, and it’ll offer to make the necessary change to the configuration (Web.config) file for you—see below Figure Confirm the change by clicking OK.
                      Figure : Enabling project debugging in Visual Web Developer

  If Script Debugging is not enabled in Internet Explorer, you’ll get the dialog shown in below Figure . Check the Don’t show this dialog again checkbox, and click Yes.
                     Figure : Enabling script debugging in Internet Explorer

After all the notifications are out of the way, you should get a page like that in below Figure :
                        Figure : Executing your first ASP.NET web page

      You can now close the Internet Explorer window. Visual Web Developer will automatically detect this action and will cancel debugging mode, allowing you to start editing the project again. Now let’s do something with that Label control.

      For our first dynamic web page using ASP.NET, let’s write some code that will display the current time inside the Label control. That mightn’t sound very exciting, but it’s only for the purposes of this simple demonstration; don’t worry, we’ll reach the good stuff before too long. To programmatically manipulate the Label control, you’ll have to write some C# or VB.NET code, depending on the language you’ve chosen when creating the project. As suggested earlier in this chapter, ASP.NET allows web forms (.aspx pages) to contain C# or VB.NET code, or they can use separate files named code-behind files for storing this code. The Default.aspx file that was generated for you when creating the project was created with a code-behind file, and we want to edit that file now. There are many ways in which you can open that file. You can click the View Code icon at the top of the Solution Explorer window, you can right-click the Default.aspx file in Solution Explorer and choose View Code, or you can click the + symbol to expand the Default.aspx entry. No matter how you open this file, it should look like below Figure if you’re using C#, or like Figure 1.14 if you’re using VB.NET.
                    Figure : Default.aspx.cs in Visual Web Developer

                      Figure : Default.aspx.vb in Visual Web Developer

Looking at above two figures you can see that the C# version contains a definition for a method called Page_Load, while the VB.NET version doesn’t. This is the method that executes automatically when the project is executed, and we want to use it to write the code that will display the current time inside the Label control.
                       Figure : Default.aspx in Design view in Visual Web Developer

     If you’re using VB.NET, you’ll need to generate the Page_Load method first. The easiest way to have Visual Web Developer generate Page_Load for you is to open Default.aspx—not its code-behind file—and switch to Design view (as shown in Figure 1.15). If you double-click on an empty place on the form, an empty Page_Load method will be created in the code-behind file for Default.aspx.

  Now edit the Page_Load method so that it looks like this, selecting the version that applies to your chosen language:

Visual Basic          LearningASP\VB\Default.aspx.vb(excerpt)
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object,
ByVal e As System.EventArgs)
Handles Me.Load
myTimeLabel.Text = DateTime.Now.ToString()
End Sub
End Class

C#                  LearningASP\CS\Default.aspx.cs(excerpt)
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
myTimeLabel.Text = DateTime.Now.ToString();
}
}

If you’ve never done any server-side programming before, the code may look a little scary. But before we analyze it in detail, let’s load the page and test that it works for real. To see your dynamically generated web page content in all its glory, hit F5 to execute the project again, and see the current date and time, as depicted in below Figure .
Figure : Loading Default.aspx with a Label element with dynamically generated content
 
Both versions of the page achieve exactly the same thing. You can even save them both, giving each a different filename, and test them separately. Alternatively, you can create two Visual Web Developer projects one for C# code, in C:\LearningASP\CS, and one for VB.NET code, in C:\LearningASP\VB.

So how does the code work? Let’s break down some of the elements that make up the page. We’re defining a method called Page_Load, in both languages:
Visual Basic                  LearningASP\VB\Default.aspx.vb(excerpt)
Protected Sub Page_Load(ByVal sender As Object,
ByVal e As System.EventArgs)
Handles Me.Load

C#                                  LearningASP\CS\Default.aspx.cs(excerpt)
protected void Page_Load(object sender, EventArgs e)
{

  I won’t go into too much detail here. For now, all you need to know is that you can write script fragments that are run in response to different events, such as a button being clicked or an item being selected from a drop-down. What the first line of code basically says is, “execute the following script whenever the page is loaded.” Note that C# groups code into blocks with curly braces ({and }), while Visual Basic uses statements such as End Sub to mark the end of a particular code sequence. So, the curly brace ({) in the C# code above marks the start of the script that will be executed when the page loads for the first time.

 Here’s the line that actually displays the time on the page:
Visual Basic                     LearningASP\VB\Default.aspx.vb(excerpt)
myTimeLabel.Text = DateTime.Now.ToString()

C#                                    LearningASP\CS\Default.aspx.cs(excerpt)
myTimeLabel.Text = DateTime.Now.ToString();
  As you can see, these .NET languages have much in common, because they’re both built on the .NET Framework. In fact, the only difference between the ways the two languages handle the above line is that C# ends lines of code with a semicolon (;). In plain English, here’s what this line says:
Set the Text of myTimeLabel to the current date and time, expressed as text

     Note that myTimeLabelis the value we gave for the idattribute of the <asp:Label/> tag where we want to show the time. So, myTimeLabel.Text, or the Text property of myTimeLabel, refers to the text that will be displayed by the tag. DateTime is a class that’s built into the .NET Framework; it lets you perform all sorts of useful functions with dates and times. The .NET Framework has thousands of these classes, which do countless handy things. The classes are collectively known as the .NET Framework Class Library.

     The DateTime class has a property called Now, which returns the current date and time. This Now property has a method called ToString, which expresses that date and time as text (a segment of text is called a string in programming circles). Classes, properties, and methods: these are all important words in the vocabulary of any programmer, and we’ll discuss them in more detail a little later in the book. For now, all you need to take away from this discussion is that DateTime.Now.To-String() will give you the current date and time as a text string, which you can then tell your <asp:Label/> tag to display.

     The rest of the script block simply ties up loose ends. The End Sub in the VB code, and the } in the C# code, mark the end of the script that’s to be run when the page is loaded:
Visual Basic                   LearningASP\VB\Default.aspx.vb(excerpt)
End Sub


C#                                 LearningASP\CS\Default.aspx.cs(excerpt)
}

  One final thing that’s worth investigating is the code that ASP.NET generated for you. It’s clear by now that your web browser receives only HTML (no server-side code!), so what kind of HTML was generated for that label? The answer is easy to find! With the page displayed in your browser, you can use the browser’s View Source feature to view the page’s HTML code. Here’s what you’ll see:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Welcome to Build Your Own ASP.NET 3.5 Web Site!
</title>
</head>
<body>
<form name="form1" method="post" action="Default.aspx"id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"value="…" />
</div>
<div>
<p>Hello there!</p>
<p>
The time is now:
<span id="myTimeLabel">5/13/2008 3:10:38 PM</span>
</p>
</div>
</form>
</body>
</html>

  Notice that all the ASP.NET code has gone? Even the <asp:Label/> tag has been replaced by a <span> tag (which has the same id attribute as the <asp:Label/> tag we used) that contains the date and time. There’s a mysterious hidden inputelement named __VIEWSTATE that is used by ASP.NET for certain purposes, but we’ll ignore it for now. (Don’t worry, we’ll discuss it a bit later in the book!)

  That’s how ASP.NET works. From the web browser’s point of view, there’s nothing special about an ASP.NET page; it’s just plain HTML like any other. All the ASP.NET code is run by your web server and converted to plain HTML that’s sent to the browser. So far, so good, but the example above was fairly simple. The next chapter will get a bit more challenging as we investigate some valuable programming concepts.

Installing SQL Server Management Studio Express | ASP.Net Tutorial | ASP.Net Tutorial PDF

  You’ve just installed Visual Web Developer and SQL Server 2005 Express Editions. You won’t use SQL Server until later in the book when we discuss relational databases, but we’ll install all the required software here so that when the time comes you’ll have the complete environment properly set up.

  In order to use your SQL Server 2005 instance effectively, you’ll need an administration tool to work with your databases. SQL Server Management Studio Express is a free tool provided by Microsoft that allows you to manage your instance of SQL Server 2005. To install it, follow these steps:
1. Navigate to http://www.microsoft.com/express/sql/download/ and click the Download link under the SQL Server Management Studio Express section.
2. Download the file. After the download completes, execute the file and follow the steps to install the product.

  Once it’s installed, SQL Server Manager Express can be accessed from Start > All Programs > Microsoft SQL Server 2005 > SQL Server Management Studio Express. When executed, it will first ask for your credentials, as Figure  illustrates.
                       Figure  Connecting to SQL Server
  By default, when installed, SQL Server 2005 Express Edition will only accept connections that use Windows Authentication, which means that you’ll use your Windows user account to log into the SQL Server. Since you’re the user that installed SQL Server 2005, you’ll already have full privileges to the SQL Server. Click Connect to connect to your SQL Server 2005 instance.
  After you’re authenticated, you’ll be shown the interface in Figure 1.5, which offers you many ways to interact with, and manage, your SQL Server 2005 instance.

   SQL Server Management Studio lets you browse through the objects that reside on your SQL Server, and even modify their settings. For example, you can change the security settings of your server by right-clicking COMPUTER\SQLEXPRESS (where COMPUTER is the name of your computer), choosing Properties, and selecting Security from the panel, as shown in Figure 1.6. Here we’ve modified the Server authentication mode to SQL Server and Windows Authentication mode. We’ll need this setting a bit later in the book, but you can set it now if you want, and then click OK.
                                  Figure : Managing your database server

                      Figure : Changing server settings with SQL Server Management Studio

  That’s it. Your machine is now ready to build ASP.NET web projects and SQL Server databases. Now the fun starts—it’s time to create your very first ASP.NET page!

Installing Visual Web Developer 2008 Express Edition | ASP.Net Tutorial | ASP.Net Tutorial PDF

Install Visual Web Developer 2008 Express Edition by following these simple steps:
1. Browse to http://www.microsoft.com/express/vwd/.
2. Click the Download Now! link.
3. Under the Web Install section, click the Download link for Visual Web Developer 2008 Express Edition.
4. Execute the downloaded file, vnssetup.exe.
5. After you accept the terms and conditions, you’re offered two additional optional products: MSDN Express Library, which   contains the product and framework documentation, and SQL Server 2005 Express Edition. Make sure to tick both options. This   is very important, as we’ll be needing the SQL Server Express Edition database server to complete projects later in the   book. Click Next.

                               Figure : Installing Visual Web Developer 2008 Express Edition
 6.In the next setup screen you’ll be informed of the products and components you’re about to install. Click Next, and wait   for the installer to download and install the software. You can see what the setup window looks like in Figure above.
7.Start Visual Web Developer to ensure it has installed correctly for you. Its welcome screen should look like Figure below.
8 Build Your Own ASP.NET 3.5 Web Site Using C# & VB.

                        Figure : The Start Page of Visual Web Developer 2008 Express Edition


Installing the Required Software | ASP.Net Tutorial | ASP.Net Tutorial PDF


If you’re going to learn ASP.NET, you first need to make sure you have all the necessary software components installed and working on your system. Let’s take care of this before we move on.

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 autocompletion technology), database integration with the ability to design databases and data structures visually, and much more. You’re in for a lot of Visual Web Developer fun during the course of this book.

.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. You’ll learn how to use SQL Server to store and manipulate the data for the DorkNozzle application you’ll build in this book.

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.

What is ASP.NET? | ASP.Net Tutorial | ASP.Net Tutorial PDF

   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. However, we believe you’ll find the benefits amply reward the learning effort!

  In the next few sections, we’ll introduce you to the basics of ASP.NET. We’ll walk through the process of installing it on your web server, and look at a simple example that demonstrates how ASP.NET pages are constructed. But first, let’s define what ASP.NET actually is.

  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.

  Server-side technologies such as ASP.NET, however, are a different story. Instead of being interpreted by the client, server-side code (for example, the code in an ASP.NET page) is interpreted by the web server. In the case of ASP.NET, the code in the page is read by the server and used to generate the HTML, JavaScript, and CSS, which is then sent to the browser. Since the processing of the ASP.NET code occurs on the server, it’s called a server-side technology. As Figure 1.1 shows, the client only sees the HTML, JavaScript, and CSS. The server is entirely responsible for processing the server-side code.

                               Figure : A user interacting with a web application


Note the three roles involved in such a transaction:
user    :    The transaction starts and ends with the user. The user operates the web client software and    interprets the results.
web client  :  This is the software program that the person uses to interact with the web application. The client is usually a web browser, such as Internet Explorer or Firefox.
web server  :   This is the software program located on the server. It processes requests made by the web client.

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. However, rather than tying you to a specific technology and language, ASP.NET lets you write web applications in a variety of familiar programming languages.

  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.

  Even with all the jargon explained, you’re probably still wondering what makes ASP.NET so good. The truth is that there are many server-side technologies around, each of which has its own strengths and weaknesses. Yet ASP.NET has a few unique features:

  •   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), which are the ones we’ll cover in this book.
  •   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. During the course of this book, you’ll learn how to add powerful features to your web site, and to reuse them in many places with a minimum of effort.
  •   You can get excellent tools that assist in developing ASP.NET web applications. Visual Web Developer 2008 is a free, powerful visual editor that includes features such as code autocompletion, code formatting, database integration functionality, a visual HTML editor, debugging, and more. In the course of this book, you’ll learn how to use this tool to build the examples we discuss.
  •  The .NET Framework was first available only to the Microsoft Windows platform, but thanks to projects such as Mono,1 it’s since been ported to other operating systems.


Introducing ASP.NET and the .NET Platform | ASP.Net Tutorial | ASP.Net Tutorial PDF

  ASP.NET is one of the most exciting web development technologies on offer today. When Microsoft released the first version in 2002, many web developers thought all their dreams had come true. Here was a powerful platform with lots of built-in functionality, astonishing performance levels, and one of the best IDEs (Integrated Development Environments) around: Visual Studio. What more could anyone want? Indeed, ASP.NET showed the way for the faster, easier, and more disciplined development of dynamic web sites, and the results were impressive.

  Time has passed, and ASP.NET has grown. ASP.NET 3.5 comes with extraordinary new features as well as an expanded and more powerful underlying framework. Not only that, but the basic versions of all development tools, including Visual Web Developer 2008 Express Edition and SQL Server 2005 Express Edition, are still free!

  This Tutorial shows you how to use all these technologies together in order to produce fantastic results. We’ll take you step by step through each task, showing you how to get the most out of each technology and tool. Let’s begin!
Build Your Own ASP.NET 3.5 Web Site Using C# & VB

ASP.Net Tutorial | ASP.Net Tutorial PDF | ASP.Net Tutorial For Beginners | ASP.Net Tutorial PDF free download | ASP.Net Tutorial For Beginners with Examples