Beruflich Dokumente
Kultur Dokumente
NET
Microsoft .NET Framework
C# VB.NET J# C++ …
Data and XML Classes
Base Framework Classes
Common Language Runtime
Overview MyPage.aspx
Http Page
Handler
(.aspx)
HtmlForm
Http Application
TextBox Button
Http Module (Authorization)
Http Module (Authentication)
Http Module (OutputCache)
Internet
ASP.NET Application
Resides in a folder on a web server (IIS)
The web site is configured for ASP.NET, meaning it
is set to handle .aspx page requests by sending them
to the ASP.NET Runtime
web.config application configuration file
Aspx files
.dll assembly of compiled codebehind and other
classes
Global Programming (Global.asax)
<authentication>
Windows
Forms
Passport
<authorization>
<allow>
<deny>
<identity>
impersonate attribute
userName and password attributes
Can be stored encrypted in the registry
ASP.NET Application Security
Page.User
Identity
GenericPrincipal and Roles
PrincipalPermission and IsInRole
IIS Configuration
Interaction with Application Security
Integrated, Basic, Digest, Kerberos
Accessing Backend Resources (Architecture)
System.Web.UI.Page
ASP.NET Web Page Consists of
An .aspx page
An optional .NET class file containing code for that page
Any user controls used by the page
Think of the page as an object
Controls are object variables
Access them in code
Inline (Inferior)
Code is interspersed with HTML
Code Behind (Superior)
Code resides in a separate class file
The Page Directive
Defines page-specific (.aspx file) attributes used by the
ASP.NET page parser and compiler.
End Sub
Search
PostBack
Event flow in ASP.NET pages
(.aspx)
Application Level Events (Global.asax)
Page_Init: page and controls are initialized
Page_Load: all the controls and page are loaded
Change events for controls are processed
Click events for controls are processed
Page_PreRender: page is about to render
Page_Unload: page is unloaded from memory
Controls
WebForm Controls
HTML Controls
Web User Controls
Custom Controls
What’s in the Toolbox?
• WebForm Controls
• TextBox, Label, Hyperlink, Etc
• DropDownList, DataGrid, DataList, Etc
• HTML Controls (Client or Server)
• ADO.NET Design Controls
• System Components
• Validation Controls
BSG Technical Briefin 12/07/21 14
g
WebForm Vs HTML Controls
Both have the following benefits
An object model that you can program against on the server 1
A set of events for which you can write sever side event handlers. 1
The ability to handle events in client script . 1
Automatic maintenance of the control's state (ViewState). 1
Interaction with validation controls so you can easily verify that a user has entered appropriate
information into a control. 1
Data binding to one or more properties of the control. 1
Support for HTML 4.0 styles if the Web Forms page is displayed in a browser that supports cascading style sheets. 1
Pass-through of custom attributes. 1
HTML Controls Advantage
Object model with a one-to-one mapping to HTML elements 1
WebForm Controls Advantage
A richer object model that provides type-safe programming capabilities. 1
Automatic browser detection. 1
For some controls, the ability to define your own look for the control using templates. 1
For some controls, the ability to specify whether a control's event causes immediate posting to the server or is instead
cached and raised when the form is submitted. 1
Ability to pass events from a nested control (such as a button in a table) to the container control. 1
RequiredFieldValidator
CompareValidator
RangeValidator
RegularExpressionValidator
CustomValidator
ValidationSummary
Can be XCopy’d
Usually only the .aspx pages and the compiled
codebehind assembly