|
1
|
|
|
2
|
- Browsers transmit Accept-Language headers identifying language
preferences
- You can use this information to localize output from FCL methods called
by ASP.NET apps
- Application_BeginRequest
- Thread.CurrentCulture
- CultureInfo
|
|
3
|
|
|
4
|
- HTTP handlers are classes that handle HTTP requests
- Mapped to file names and file name extensions in CONFIG files
- Implement IHttpHandler
- Built-in handlers handle requests for ASPX files, ASMX files, and other
ASP.NET file types
- Custom HTTP handlers respond to requests in any way you want
- Generate images from user input (e.g., graphs)
- Convert XML to HTML using XSLT
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
- Common performance bottlenecks in Web apps:
- File accesses
- Database accesses
- ASP.NET application cache provides a fast and easy-to-use means for
caching data (any data) to minimize I/O
- Can hold anything derived from System.Object
- Supports expiration policies and dependencies
- Optionally notifies you when an item is removed
- A key to great performance!
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
|
16
|
- Fetching an ASPX Web page incurs overhead
- ASP.NET page output cache reduces overhead by caching output from pages
- You control cache duration
- You control other caching parameters, too
- Caching can be performed at two levels:
- Page level (ASPX files)
- Sub-page level (ASCX files)
|
|
17
|
|
|
18
|
- To cache different versions of a page based on the value of an input
parameter, identify the parameter with VaryByParam
- Separate multiple parameters with semicolons
- Use * to represent any input parameter
|
|
19
|
|
|
20
|
- To cache different versions of a user control based on the value of a
property, identify the property with VaryByControl
- Separate multiple properties with semicolons
- Use * to represent any property
|
|
21
|
- Fired when unhandled exceptions occur
- Process them in Global.asax and let someone know that the application is
sick
- Should be considered de rigueur in ASP.NET apps!
|
|
22
|
- Record error in system event log
|
|
23
|
- E-mail a system administrator
|
|
24
|
- DataGrid controls are highly customizable
- Public properties
- Custom columns (including TemplateColumns)
- ItemCreated events
- ItemCreated events are the key to advanced DataGrid customizations
- Fired for each row rendered by a DataGrid
- Use them to customize a DataGrid’s HTML output
- Use them to inject client-side script
|
|
25
|
|
|
26
|
|
|
27
|
|
|
28
|
- Many ASP.NET server controls use view state to persist state from one
request to the next
- TextBox, ListBox, and so on
- View state is round-tripped in __VIEWSTATE controls
- View state often isn’t necessary
- Used to fire change events
- Used to preserve state in controls whose state isn't fully encapsulated
in postback data
- Disable view state when it isn’t needed
- Reduces the data passed in each request
- Increases performance
|
|
29
|
|
|
30
|
|
|
31
|
- Without EnableViewState=“false”
- With EnableViewState=“false”
|
|
32
|
- By default, ASP.NET doesn’t verify that view state round-tripped to the
client and back isn’t altered
- Leaves open the possibility of tampering
- Use EnableViewStateMac to prevent tampering
- For an individual page
- For all pages
|
|
33
|
- Derive from Control or WebControl to create “from-scratch” custom
controls
- Derive from existing control classes to leverage functionality already
built in
- Override inherited methods and properties as needed (especially the
Render method)
- Add new methods and properties, too
|
|
34
|
|
|
35
|
|
|
36
|
- HTML is a limited medium for expressing UIs
- Browser-based UIs can be made richer with client-side script, but even
that only goes so far
- Use Windows Forms controls in Web pages to build ultra-rich
browser-based UIs
- Requires .NET Framework on the client
- Requires IE 5.01 or higher
- For a cool sample, see
http://www.wintellect.com/resources/faqs/-default.asp?faq_id=1&page=5
|
|
37
|
|
|
38
|
|