Developing an ASP.NET Application and using the Mobile Internet Toolkit Bart Vande Ghinste Developer Consultant Microsoft Belux
2 Agenda Architectural Overview Data Binding Validating User Input Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
3 Presentation Data Architectural Overview WS Façade (asmx) WS Façade (asmx) WIN Service WIN Service Business WS Façade WS Façade ES Façade ES Façade Biz Services Biz Services DALDAL DALDAL SPSP SPSP or browser admin reporter ASP.NET UI (aspx) ASP.NET UI (aspx)
4 Football247.net Football247.Presentation User Tier Business Tier Data Tier System Architecture Solution Structure Application Architecture.Administrator,.Reporter.WebSite.WebControls.WinControls.Facades Football247.Business.Facades.Host.Services Football247.Data.DataAccess Football247.Common.Core.Datasets
5 Agenda Architectural Overview Data Binding Validating User Input Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
6 Data Binding Support in ASP.NET Binding controls to a data source Based on the fact that most data access is read only Search Pages Displaying Team or player data Several data sources can be used Datasets Collections IBindingList Interface You can assign data to any run-time accessible property Display Text TextBox, Button etc. Target Page of link controls Also Width, Height, BgColor, Class…
7 Data Binding Support in VS.NET Different types of data binding Multi Record Controls Repeater DataList DataGrid … Single Value Controls Label TextBox … HTML Server Controls Data Binding Expressions Design Time versus Run Time Binding Use the DataBinding Event to bind during Run Time Combine Design Time and Run Time
8 Data Binding Support in ASP.NET
9 Agenda Architectural Overview Data Binding Validating User Input Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
10 Validating User Input Validation Controls Validation Controls can validate HTML Controls Web Server Controls Validation happens when Click events are processed Page.IsValid Property Multiple conditions are tested with a Logical AND Programmatically by calling Validate Method Types of Validation TypeControl Required EntryRequiredFieldValidator Value ComparisonCompareValidator Range CheckingRangeValidator Pattern MatchingRegularExpressionValidator User DefinedCustomValidator
11 Validating User Input Validation Controls Server-Side and Client-Side Validation Always Server-Side Also Client-Side if browser supports DHTML Custom Validation Complete Control over Format and location to place output BaseValidator Control Displaying Error Information Display OptionError Output Location In PlaceNext to Validated Control SummaryIn one dedicated place In Place and SummaryShow shorter message or glyph in place, detailed message at other location CustomFull Control
12 Validating User Input
13 Agenda Architectural Overview Data Binding Validating User Input Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
14 Authentication and Authorization Authentication is process of obtaining credentials and validating against some authority Authorization is to determine if identity is granted access to a resource File Authorization URL Authorization Impersonation is acting of behalf of the calling Identity Authentication Providers in ASP.NET Authentication ProviderDescription Forms AuthenticationUnauthenticated request are redirected to HTML Form acquiring user credentials Passport AuthenticationCentralized Authentication Service Windows AuthenticationProvided by IIS Basic Digest Integrated with NTML or Kerberos
15 Forms Authentication IIS Browser Forms Authentication Module Get Shop.aspx Redirect SignIn.aspx Post SignIn.aspx Authenticate Credentials BUSINESSFACADEBUSINESSFACADE BUSINESSFACADEBUSINESSFACADE Authentication Data Set Cookie + Redirect Get Shop.aspx Global.asax AuthenticateRequest Context.User = Principal Global.asax AuthenticateRequest Context.User = Principal web.config
16 Forms Authentication Web.config Configuration FormsAuthentication Utility Class SignOut Encrypt/Decrypt GetRedirectURL …
17 ASP.NET Authorization File Authorization Handled by the FileAuthorizationModule Active when using Windows Authentication Checks the ACL URL Authorization Handled by the URLAuthorizationModule Maps Users and Roles to URI namespace Special Identities Web.config IdentityDescription *Refers to all identities ?Refers to the anonymous identity
18 Authentication and Authorization
19 Agenda Architectural Overview Handling Business Data Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
20 User Controls Similar to Web Page User Interface Code Behind File No HTML, BODY or FORM elements Extension is.ascx Advantages Easy to create Good for static layout Same programming technique as web pages Disadvantages No UI in VS.NET Limited Visual Design Support Separate copy of control is required in each application Cannot be added to the toolbox in VS.NET
21 User Controls
22 Agenda Architectural Overview Data Binding Validating User Input Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
23 Server Controls Compiled Component Resides in an Assembly Can be signed and versioned Can be placed in the GAC Advantages Full Visual Design Support in VS.NET UI in Design Mode Custom Editors Only a single copy is required Good for dynamic layout Can be added to the toolbox in VS.NET Disadvantages Harder to create compared to User Controls
24 Server Controls
25 Agenda Architectural Overview Data Binding Validating User Input Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
26 client-side applications code web pages Visual Studio.NET.NET Framework Mobile Web Browser.NET Compact Framework web applications client-side applications Mobile Internet Toolkit
27 Mobile Internet Toolkit Automatically adapts display and interaction for mobile devices Web-enabled cell phones PDA Generates HTML, WML or CHTML Extends VS.NET and.NET Framework Mobile Internet Designer Mobile Internet Controls Runtime Emulators are provided by hardware manufactures
28 Mobile Internet Toolkit
29 Agenda Architectural Overview Data Binding Validating User Input Authentication and Authorization User Controls Server Controls Mobile Internet Toolkit Tips and Tricks from the Trade
30 Tips and Tricks from the Trade Dynamic Web Service Endpoints web.config Uri Property of Web Reference Several HTC’s are available WebService Behaviour ToolTip Behaviour … ASP.NET Caching with Cache Class Time based External Dependencies DataView Component Easiest way to filter data Avoids unnecessary sorting round trips
31 Tips and Tricks from the Trade
32 Resources Football247.Net Workspace on haviors_node_entry.asp?frame=true haviors_node_entry.asp?frame=true
33 © 2002 Microsoft Corporation. All rights reserved.