Introduction to ASP.NET 3.5
•	CS 233S – Session I
Server Side Programming
•	Limitation of client side technologies
•	HTML = static
o	JavaScript = dependent upon existence of client-side script engine
•	Server-side programming allows more consistent interpretation/compiling of dynamic code, as well as access to other server resources (databases)
•	File extensions (.php, .aspx, etc.) on server-side pages trigger server to process all marked server-side commands before sending to client
o	Client receives text-only HTML data
Server-Side Request-Response Model
Server-Side Technologies
•	ColdFusion (Adobe/Macromedia)
•	.cfm file extensions
•	PHP (open source)
•	.php file extensions
•	Java Server Pages (Sun Technology)
•	.jsp file extensions
•	ASP/ASP.NET (Microsoft)
•	.asp or .aspx file extensions
ASP.NET Overview
•	Loosely related to classic ASP
•	Combination of technologies
o	ASP Objects
o	Database Objects
o	Embedded language
•	New concept =  .Net Framework
•	Huge libraries of pre-built objects
•	Improved database access
•	Common Language Runtime
o	Can use any .NET-compatible language as embedded language
o	C #, VB.NET, J#, Fortran.NET (!!), etc.
o	Common Type System
o	Garbage Collection
o	Intermediate Language
Base Class Libraries
•	Collections of functions usable by any .NET application.
•	Stored in Dynamic Link Library files (.dll files)
•	Fundamental class for ASP.NET web pages is the Page Class
•	Each web page created with ASP.NET is an object based upon the page class
•	Each ASP.NET page shares the properties, methods and functions and events of the Page Class definition.
Namespace
•	Namespaces are part of the Base Class Libraries
•	An organized, hierarchical collection of objects that may be used by .Net applications
•	The correct namespace must be instantiated before the controls that it contains can be used in an ASP.NET page
Anatomy of an ASP.NET Application
•	ASP.NET Applications are websites with some extra features:
•	Stored in a single folder: the application root
•	Contain an App_Data folder: the default location for data stores
•	Contain a Web.Config file: an XML file with application-wide settings 
o	Available namespaces 
o	DB connection strings
o	Debugging settings
•	Other pages as desired, saved with a .aspx file extension
ASP.NET Developer Toolbelt
•	Development environment
•	Text editor
•	Dreamweaver
•	Visual Web Developer Express
•	Visual Studio
•	Database Engine
•	SQL Server
•	MySQL
•	Oracle
•	.NET-compatible Web Server Engine
•	IIS
•	Cassini
Visual Web Developer Express
•	Free download (or available through MSDNAA and Elms)
•	http://www.microsoft.com/express/Web/
•	Lightweight
•	Built-ins
•	.Net framework
•	Web Server (Cassini engine)
•	Database engine (SQL Server Express)
ASP.NET Page Elements
•	HTML tags processed by client browser only
•	Traditional HTML controls with a runat=“server” attribute added.
•	Server will interact with these controls
•	<input type=“text” id=“txtName” runat=“server” />
•	New ASP.NET controls
•	Mimic traditional HTML form controls/tables; contain additional functionality
•	Tagnames all begin with asp:
o	<asp:adrotator id= "bnrMain" runat= "server" datasourceid= "Sponsors" />
o	<asp:textbox id= "txtName" runat="server" causesvalidation="True"></asp:TextBox>
•	Script Commands
•	Embedded language commands contained inside <script runat=“server“> tags or <% %> tags.
•	Code could also be contained in a separate, text-only file identified in the page directive
o	<%@ Page Language="VB" CodeFile=“pagename.aspx.vb" %>
PostBack
•	A critical feature of ASP.NET controls is postback
•	Postback is an action taken by an interactive webpage, when the entire page and its contents are sent back to the server for processing.
•	Allows for pseudo-event driven coding in .NET
•	Create event procedures for button clicks, textbox changes, drop down list changes, etc.
•	Note that the event is always page submission, the .NET framework just tracks which control on the page triggered the submission.
o	Visible in the two arguments required for every event procedure
o	Visible in HTML code generated by server as a hidden form element named _postback with an encoded string of characters as its value
•	Some ASP.NET controls always generate postback events (asp:buttons)
•	Some ASP.NET controls only generate postback after developer sets autopostback=“true” in tag (asp:textboxes)