G security sessionstate compilation customerrors

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: writable by people and machines Configuration Settings specified in configuration sections, e.g. Security, SessionState, Compilation, CustomErrors, ProcessModel, HTTPHandlers, Globalization, AppSettings, WebServices, WebControls, etc. Configuration information stored in web.config It is just a file, no DLL registration, no Registry settings <!-- web.config can have comments --> 6 Configuration Configuration Hierarchy Configuration files can be stored in application folders Configuration system automatically detects changes Hierarchical configuration architecture Applies to the actual directory and all subdirectories Root Dir web.config Sub Dir1 Sub Dir2 Configuration web.config Sample <configuration> <configsections> <add names=“httpmodules“ type=“System.Web.Config.HttpModulesConfigHandler“/> <add names=“sessionState“ type=“...“/> </configsections> <httpModules> <!----> <!--- http module subelements go here --> </httpModules> <sessionState> <!----> <!--- sessionstate subelements go here --> </sessionState> </configuration> 7 Configuration Configuration Hierarchy Standard machine-wide configuration file Provides standard set of configuration section handlers Is inherited by all Web Applications on the machine C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\ C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config Configuration User-defined Settings Create web.config in appropriate folder <configuration> <appSettings> <add key=“CxnString” value=“localhost;uid=sa;pwd=;Database=foo”/> </appSettings> </configuration> Retrieve settings at run-time string cxnStr = ConfigurationSettings .AppSettings["CxnString"]; 8 Outline IIS Web Applications Configuration Tracing State Management Caching Error Handling Tracing ASP.NET supports tracing Easy way to include “debug” statements No more messy Response.Write() calls! Debug statements can be left in, but turned off Great way to collect request details Server control tree Server variables, headers, cookies Form/Query string parameters Tracing provides a wealth of information about the page Can be enabled at page- or application- level 9 Tracing Methods and Properties Methods Trace.Write: Writes category and text to trace Trace.Warn: Writes category and text to trace in red Properties Trace.IsEnabled: True if tracing is turned on for the...
View Full Document

This note was uploaded on 04/04/2014 for the course CS 5950 taught by Professor Staff during the Summer '08 term at Western Michigan.

Ask a homework question - tutors are online