Introduction to ASP.NET
What’s new
- ASPX instead of ASP
- Object Oriented
- Object Model
- Type Safe – no variant
- Multiple Languages
- Compiled
- Code Behind
Parts of an ASP.NET Page
- Web Form
- Code Behind
- HTML Server Controls
- Web Server Controls
- Validation Controls
- User Controls
Web Forms
- <form runat=“server”>
- Only one per page
- Posts back to the same page (itself)
Code Behind
- Contains back end code
- Separates page logic from page layout
- Generates code automatically for design time actions
- Creates handlers for events as required
HTML Server Controls
- Look and feel like normal HTML elements
- Equivalents for all standard elements available
- Adds runat=“server” to the control
- Allows server side interaction with controls ( Not possible with HTML elements)
Web Server Controls
- Recommended way to use and create controls
- Lots of controls available out of the box
- Includes DataGrid, DataList, Repeater and more
- Contain full Object Model:
- Properties
- Events
- Methods
- Automatic browser detection and rendering
Validation Controls
- Controls that allow input validation
- Work at: Client side (JavaScript), Server Side
- Currently present are:
- RequiredFieldValidator
- CompareValidator
- RangeValidator
- RegularExpressionValidator
- CustomValidator
- ValidationSummary
User Controls
- User created controls
- Can be re-used in other Web pages
- Requires no extra knowledge
- Use file extension of ASCX
No comments yet.