ASP.NET Awareness

ASP.NET Awareness

ASP.NET

  • A development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting
  • Supports three different development models
    • Web Forms
    • Web Pages
    • Model View Controller (MVC)
  • ASP.NET web pages are called Web Forms

Web Pages

  • Simplest ASP.NET model
  • Similar to PHP and classic ASP

Web Forms

  • ASP.NET web pages with added server controls, server events, and server code
  • Contained in files with an .aspx extension
  • Compiled and executed on the server, which generates the HTML that displays the web pages
  • The classic ASP.NET event driven development model with submits and post backs
  • Contain a directive with instructions on how ASP.NET should process the page
    • The most common directive is <%@ Page %>
    •  <%@ Page %> is used to specify many attributes for the page

MVC

  • Web applications are separated into three different components
    • Models for data
    • Views for display
    • Controllers for input

Classic ASP

  • Code blocks had to be located where you wanted the output to appear
  • Code and HTML were mixed together, making the page difficult to read and maintain

Server Controls

  • Tags that enable developers to separate code from HTML markup
  • Must be placed within a <form> tag on a web page with the runat="server" attribute
    • The form is processed on the server when there is a runat="server" attribute
    • This enables the enclosed controls to be accessed by server scripts
  • There are three types of server controls
    • HTML Server Controls - Traditional HTML tags
    • Web Server Controls - New ASP.NET tags
    • Validation Server Controls - For input validation

Sources