ASP.NET WebForms 4.5 uudet piirteet



Similar documents
This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

TS: Microsoft.NET Framework 3.5, ASP.NET Application Development

This tutorial assumes that you are familiar with ASP.Net and ActiveX controls.

Developer Tutorial Version 1. 0 February 2015

Nikhil s Web Development Helper

Sense/Net ECM Evaluation Guide. How to build a products listing site from the scratch?

Sitecore Dynamic Links

App Development for Modern UI MODULE 4: APP DEVELOPMENT ESSENTIALS

WebSocket Server. To understand the Wakanda Server side WebSocket support, it is important to identify the different parts and how they interact:

DIPLOMA IN WEBDEVELOPMENT

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql

WEBfactory Silverlight vs. HTML 5 Version 1.0. July

Analytics Configuration Reference

MOVING THE SENIOR DEVELOPMENT CLASS FROM WEB DEVELOPMENT TO LIFE CYCLE DEVELOPMENT A CASE FOR VISUAL STUDIO 2005

WEB DEVELOPMENT IA & IB (893 & 894)

ASP.NET 5 SOMEONE MOVED YOUR CHEESE. J. Tower

Expanded contents. Section 1. Chapter 2. The essence off ASP.NET web programming. An introduction to ASP.NET web programming

SEO Optimization A Developer s Role

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

Capturx for SharePoint 2.0: Notification Workflows

Finding and Preventing Cross- Site Request Forgery. Tom Gallagher Security Test Lead, Microsoft

ASP.NET and Web Forms


Simply type the id# in the search mechanism of ACS Skills Online to access the learning assets outlined below.

ASP.NET Using C# (VS2012)

SQL Server 2005 Reporting Services (SSRS)

Unit 3: Optimizing Web Application Performance

TO HACK AN ASP.NET WEBSITE?

TIBCO Spotfire Web Player 6.0. Installation and Configuration Manual

COURSE CURRICULUM COURSE TITLE: WEB PROGRAMMING USING ASP.NET (COURSE CODE: )

4 Understanding. Web Applications IN THIS CHAPTER. 4.1 Understand Web page development. 4.2 Understand Microsoft ASP.NET Web application development

Introduction to Building Windows Store Apps with Windows Azure Mobile Services

What about MongoDB? can req.body.input 0; var date = new Date(); do {curdate = new Date();} while(curdate-date<10000)

Web Development I & II*

Developing ASP.NET MVC 4 Web Applications MOC 20486

Getting Started with ASP.NET 4.5 Web Forms and Visual Studio 2013

Microsoft SQL Server Review

Hands-On Lab. Building a Data-Driven Master/Detail Business Form using Visual Studio Lab version: Last updated: 12/10/2010.

Download this chapter for free at:

Transition your MCPD Web Developer Skills to MCPD ASP.NET Developer 3.5 (VB)

Course Syllabus. Configuring and Troubleshooting Internet Information Services in Windows Server Key Data. Audience. At Course Completion

Setup The package simply needs to be installed and configured for the desired CDN s distribution server.

Instant Chime for IBM Sametime Installation Guide for Apache Tomcat and Microsoft SQL

Visual COBOL ASP.NET Shopping Cart Demonstration

User Guide for Smart Former Gold (v. 1.0) by IToris Inc. team

Citrix StoreFront. Customizing the Receiver for Web User Interface Citrix. All rights reserved.

Acunetix Website Audit. 5 November, Developer Report. Generated by Acunetix WVS Reporter (v8.0 Build )

SelectSurvey.NET Developers Manual

Project 2: Web Security Pitfalls

HTML5. Eoin Keary CTO BCC Risk Advisory.

Custom Error Pages in ASP.NET Prabhu Sunderaraman

Sitecore Ecommerce Enterprise Edition Installation Guide Installation guide for administrators and developers

ASP.NET Forms Authentication Best Practices for Software Developers

4.2 Understand Microsoft ASP.NET Web Application Development

Check list for web developers

The MVC Programming Model

Google AdWords TM Conversion Tracking Guide

Developing ASP.NET MVC 4 Web Applications Course 20486A; 5 Days, Instructor-led

Application security testing: Protecting your application and data

Microsoft.Realtests v by.ERICA.50q

How To Create A Website Template On Sitefinity

Developing ASP.NET MVC 4 Web Applications

Skills for Employment Investment Project (SEIP)

Design and Functional Specification

Dreamweaver CS5. Module 2: Website Modification

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

Introduction to Tizen SDK Alpha. Taiho Choi Samsung Electronics

Short notes on webpage programming languages

Sichere Webanwendungen mit Java

Chapter 1. Introduction to web development

Sitecore Dashboard User Guide

Dynamic Web Programming BUILDING WEB APPLICATIONS USING ASP.NET, AJAX AND JAVASCRIPT

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

SQL Server Database Web Applications

TIBCO Spotfire Metrics Prerequisites and Installation

Real Time Data in Web Applications

VB.NET - WEB PROGRAMMING

DotNet Web Developer Training Program

Threat Modeling. Categorizing the nature and severity of system vulnerabilities. John B. Dickson, CISSP

TIBCO ActiveMatrix BPM - Integration with Content Management Systems

ERIE COMMUNITY COLLEGE COURSE OUTLINE A. COURSE TITLE: CS WEB DEVELOPMENT AND PROGRAMMING FUNDAMENTALS

Introduction to ASP.NET Web Development Instructor: Frank Stepanski

National Vocational and Technical Training Commission (NAVTTC) Curriculum for. Web Design and Development

ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus

SizmekFeatures. HTML5JSSyncFeature

DNNCentric Custom Form Creator. User Manual

Lab Answer Key for Module 11: Managing Transactions and Locks

California State University Polytechnic University. CIS 311 Interactive Web Development. Fall 2011

Please contact Cyber and Technology Training at for registration and pricing information.

Migrating IIS 6.0 Web Application to New Version Guidance

.NET Best Practices Part 1 Master Pages Setup. Version 2.0

Why File Upload Forms are a Major Security Threat

This class is intended for experienced software developers who understand object-oriented programming (OOP) and C# or VB.NET.

SINGLE SIGNON FUNCTIONALITY IN HATS USING MICROSOFT SHAREPOINT PORTAL

Transcription:

ASP.NET WebForms 4.5 uudet piirteet Jari Kallonen Software Specialist at Tieturi Oy Régis Laurent Director of Operations, Global Knowledge Competencies include: Gold Learning Silver System Management

- Strongly Typed Data Controls - Model Binding - HTML Encoded Data-Binding Expressions - Unobtrusive Validation - HTML5 tuki - Muuta sälää Régis Laurent Director of Operations, Global Knowledge Competencies include: Gold Learning Silver System Management

Tyypitetty Data Bindings <div> <asp:repeater ID="CustomerRepeater" runat="server" ItemType="Demoilua.Model.Henkilo"> <ItemTemplate> <li> ID:<%# Item.ID %> Nimi:<%# Item.Nimi %> Puhelin:<%# Item.Puhelin %> </li> </ItemTemplate> </asp:repeater> </div>

Model Binding Tiedon valinta <div> <asp:repeater ID="CustomerRepeater" runat="server" ItemType="Demoilua.Model.Henkilo SelectMethod="GetData"> <ItemTemplate> <li> ID:<%# Item.ID %> Nimi:<%# Item.Nimi %> Puhelin:<%# Item.Puhelin %> </li> </ItemTemplate> </asp:repeater> </div> public IEnumerable<Demoilua.Model.Henkilo> GetData() { return Demoilua.Model.HenkiloRepository.HaeKaikki(); }

Value Providers - QueryString public IQueryable<Customer> GetCustomers( [QueryString]string keyword) { return CustomerRepository.GetByName(keyword); }

Value Providers - Kontrollit public IQueryable<Customer> GetCustomers( [Control("customers")]int? id) { if (id.hasvalue) return CustomerRepository.GetOne(id); else return CustomerRepository.GetAll(); }

Value Provider vaihtoehtoja Controls Query string values View Data Session State Cookies Posted Form data View State Custom

2-suuntainen Binding <EditItemTemplate> ID:<asp:TextBox ID="IDTextBox" runat="server" Text='<%# BindItem.ID %>' /> LastName:<asp:TextBox ID="NimiTextBox" runat="server" Text='<%# BindItem.Nimi %>' /> Puhelin:<asp:TextBox ID="PuhelinTextBox" runat="server" Text='<%# BindItem.Puhelin %>' /> </EditItemTemplate>

Demo Binding, Value Providers

Markup based validointi <asp:requiredfieldvalidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="nimiTextBox" ErrorMessage="Nimi puuttuu" ForeColor="Red" />

Unobtrusive ( huomaamaton ) validointi Pienentää sivun kokoa vähentämällä inline Javacript koodin käyttöä ->Käyttää HTML5 data-* attribuutteja ValidationSettings:UnobtrusiveValidationMode Asetus: Web.Config Global.asax Page luokka

javascript validointi

Unobtrusive validointi Edellinen Unobstrusive muodossa

Data annotaatiot Model luokassa public class Henkilo { [Key] public int ID { get; set; } [Required] public string Nimi { get; set; } [Range(0, 130)] public int Ika { get; set; } [Phone] public string Puhelin { get; set; } [EmailAddress, StringLength(256)] public string Email { get; set; } }

Joitain Data Annotaatioita CreditCard Phone EmailAddress Range Compare Url FileExtensions Required Key RegularExpression

Model luokan validointi public void SaveCustomer(Customer customer) { if (ModelState.IsValid) { using (var db = new Demoilua.Model.ProductsContext()) { db.customers.add(customer); db.savechanges(); Response.Redirect("~/Customers.aspx"); } } }

Validointikontrollit <asp:validationsummary runat="server" ShowModelStateErrors="true" ForeColor="Red" HeaderText="Please check the following errors:" /> <asp:modelerrormessage ModelStateKey="phone" runat="server" ForeColor="Red" />

Tulos:

Demo Validointi

Request validointi Korvaa tarvittaessa HttpEncoderin Auttaa suojautumaan cross-site scripting (XSS) ja LDAP injection hyökkäyksiltä AntiXSS libraryssa HtmlEncode, HtmlFormUrlEncode,HtmlAttributeEncode XmlAttributesEncode, XmlEncode UrlEncode, UrlPathEncode CssEncode

4.5 Request validointi <system.web> <httpruntime encodertype="system.web.security.antixss.antixssencoder" /> </system.web>

Tuki await/async ja Task pohjaisille pyynnöille HTTP Modules EventHandlerTaskAsyncHelper TaskEventHandler HTTP Handlers HttpTaskAsyncHandler

Async tuki Web.config <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true"/> Page directive <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ProductDetails.aspx.cs" Inherits="WebFormsLab.ProductDetails" Async="true" %>

Async Task esimerkki RegisterAsyncTask(new PageAsyncTask(async (t) => { using (var wc = new WebClient()) { //aikaisemmin wc.downloadfile await wc.downloadfiletaskasync( imageurl, Server.MapPath(product.ImagePath)); } }));

HTML5 päivityksiä TextBox TextMode Tukee email, datetime tyyppejä jne. FileUpload tuki useammalle upload tiedostolle Selainriippuvainen Validointikontrollit tukee HTML5 elementtejä runat= server lisäksi URL osoite <video runat= server src= ~/file.wmv />

ASP.NETCore päivityksiä WebSockets Protocol (IIS8) Javascriptin ja CSS:n pakkaus (Bundling / Minification) Suorituskyky Yhteisten komponenttien jako (muistin kulutus) Multi-core JIT käännös Garbage Collection Web sovellusten esilataukset

Javascriptin ja CSS:n pakkauksen määrittely using System.Web.Optimization; // public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.add(new ScriptBundle("~/bundles/jqueryui").Include( "~/Scripts/jquery-ui-{version}.js")); bundles.add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*")); bundles.add(new ScriptBundle("~/bundles/WebFormsJs").Include( "~/Scripts/WebForms/WebForms.js", "~/Scripts/WebForms/WebUIValidation.js", "~/Scripts/WebForms/MenuStandards.js", "~/Scripts/WebForms/Focus.js", "~/Scripts/WebForms/GridView.js ); } }

Visual Studio 2012 parannuksia HTML Editor Smart Tasks, loppu/alku elementin päivitys HTML 5 snippets, parempi Intellisense, http://www.asp.net/vnext/overview/whitepapers/whats-new#_toc303354490 JavaScript Editor Code outlining, Go to Definition, http://www.asp.net/vnext/overview/whitepapers/whats-new#_toc303354500 CSS Editor Color Picker, CSS 3 support, custom region (/*#region Menu */ /*#endregion */ http://www.asp.net/vnext/overview/whitepapers/whats-new#_toc303354508

Yhteenveto Model pohjainen binding Validointi Laajentunut Html 5 tuki Async/Await ja Task pohjaiset toiminnot Suorituskykyä Coreen

Kiitos ja kumarrus Jari.kallonen@tieturi.fi 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentations. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.