200 likes | 357 Views
Visual Web Developer Workshop. Aim of Today. To enable you to assess whether or not Microsoft’s Visual Web Developer Express Edition 2005 is something that would benefit you in your teaching. Relevance to A Level Curriculum. Two units: Web Development (Unit 5 ) and Web Management (Unit 13)
E N D
Visual Web Developer Workshop
Aim of Today To enable you to assess whether or not Microsoft’s Visual Web Developer Express Edition 2005 is something that would benefit you in your teaching.
Relevance to A Level Curriculum • Two units: Web Development (Unit 5 ) and Web Management (Unit 13) • Unit 13 says that ‘The website you build in Unit 5 had only limited functionality’ • Units 13 suggests ‘creating a data entry form on the site linked to a database’ (Edexcel AS/A GCE in Applied ICT – Issue 1 – February 2005)
Objectives for the Afternoon • Explain the meaning of the terms stateless, client-side processing and server-side processing. • Explain the difference between .NET, Visual Studio and Visual Web Developer Express Edition. • Locate a free copy of Visual Web Developer Express Edition 2005 (and supporting materials). • Develop a website to read and write records from a database using Visual Web Developer Express Edition’s high-level data access and data display controls.
Web Applications Database Web Server Client
.NET / Visual Studio / VWD • .NET aims to support universal data access by allowing centrally-held data to be seen and edited by a PC, a PDA, a cell phone or any other Internet-enabled device. • The .NET framework is at the heart of the .NET strategy. It manages and executes applications and web services. • Currently the framework only exists for Windows. • Visual Studio is Microsoft’s industrial-strength development environment based on the .NET framework. • Visual Web Developer is a ‘light’ version of Visual Studio aimed at developers of small websites.
Microsoft Intermediate Language Source Code MSIL Machine Code
Two Technologies ADO.NET • Used for working with data from all sorts of sources – flat files and databases • Works on disconnected data sources • ADO.NET is XML-based so lets you work over the Internet, even if the client sits behind a firewall ASP.NET • Used for Web-based applications
ASP Applications ASP.NET Database (SQL Server) Web Server (IIS) Browser (IE) HTML ADO.NET
Username: ATGuest Password: Tuesday17
Validation • Poor error trapping and handling can turn an otherwise good program into a poor one. • Experience shows that users tend to shy away from programs with poor error trapping. • The effort involved in developing the code to trap and handle errors is often a very significant part of the overall development effort involved in the application.
Error Types Error Types Data Entry Errors Runtime Errors
Data Entry Validation Data Entry Validation Key Validation Field Validation Form Validation
Best Practice • Trap all errors (and potential errors) • Display clear and meaningful messages • Give direction about what action needs to be taken • Place the cursor in the field that needs changing • Give users the opportunity to correct errors at the earliest possible stage
RequiredFieldValidator Control • Used to specify that users must put information into a control • Checked once a page has been submitted or an existing value is changed • Can be used in conjunction with other validation controls • You can use as many validation controls as you wish for a user-entry field
Triggering Validation • Server-side validation versus client-side validation • Use of the AutoPostBack and CausesValidation properties • Generally best to validate on a Submit button • Use of the ValidationGroup property for linking the Submit button to all the validation controls
Other Validation Controls • Range • RegularExpression • Compare • Custom
CustomValidator: Code Snippet Protected Sub cvrDateStay_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles cvrDateStay.ServerValidate Try DateTime.ParseExact(args.Value, "d", Nothing) args.IsValid = True Catch args.IsValid = False End Try End Sub
ValidationSummary Control • Can be used to produce a list of all errors on a page • Set the DisplayMode Property to List, BulletList or SingleParagraph • Checked once a page has been submitted