Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
F I N
Plus de contenu associé
Transcription de la présentation
ITEC5620 - Advance Web Programming Advance Web Programming อ.ชไลเวท พิพัฒพรรณวงศ์ Chalaivate Pipatpannawong Computer Instructor Microsoft Certificate Professional Web : www.9Expert.co.th ; Thaiwebdev.com E-Mail: chalaivate@chalaivate.com ปริญญาโท สาขาวิชา เทคโนโลยีสารสนเทศ
New Features at a Glance Data Controls Login Controls Web Parts Other New Controls Controls Master Pages Themes and Skins Mobility and Localization Compilation Page Framework Membership Role Management Profiles Configuration Services and APIs Site Maps Health Monitoring Other Services
What's New in Data Access • Data source controls • Declarative 2-way data binding • Data controls • GridView - Like the DataGrid, only better • DetailsView - Companion to GridView • SQL cache dependencies • Key cached items to database entities • Simplified data binding expressions
What's New for UIs • Master pages • "Visual inheritance" for Web pages • Applied declaratively or programmatically • Themes and skins • Theme controls, pages, and entire sites • Applied declaratively or programmatically • New controls (more than 50 in all) • Menus, TreeViews, Wizards, and more
What's New in Security • Membership service • Service for managing users and credentials • Provider-based for flexible data storage • Login controls • Controls for logging in, creating new users, recovering lost passwords, and more • Role Management service • Combine forms authentication and role-based authorization without writing code!
Validating Logins if (Membership.ValidateUser (UserName.Text, Password.Text)) RedirectFromLoginPage (UserName.Text, RememberMe.Checked);
The Login Control <html> <body> <form runat="server"> <asp:Login RunAt="server" /> </form> </body> </html>
Membership and Logins Chalaivate Pipatpannawong Computer Instructor www.9Expert.co.th chalaivate@9expert.com
Profiles • Store per-user data persistently • Strongly typed access (unlike session state) • On-demand lookup (unlike session state) • Long-lived (unlike session state) • Supports authenticated and anonymous users • Accessed through dynamically compiled HttpProfileBase derivatives (HttpProfile) • Provider-based for flexible data storage
Using a Profile // Increment the current user's post count Profile.Posts = Profile.Posts + 1; // Update the current user's last post date Profile.LastPost = DateTime.Now;
Persisting Data with Profiles Chalaivate Pipatpannawong Computer Instructor www.9Expert.co.th chalaivate@9expert.com
Site Navigation • Navigation UIs are tedious to implement • Especially if they rely on client-side script • New controls simplify site navigation • TreeView and Menu - Navigation UI • SiteMapDataSource - XML site maps • SiteMapPath - "Bread crumb" control • Public API provides foundation for controls • Provider-based for flexibility
Data-Driven Site Navigation Chalaivate Pipatpannawong Computer Instructor www.9Expert.co.th chalaivate@9expert.com
Providers • New model for storing and managing state • Makes storage adaptable to different media • Used by many key ASP.NET services • Membership service • Role Management service and more • Built-in providers make ASP.NET state storage very flexible • Custom providers make it infinitely flexible
The Provider Model Controls Login LoginStatus LoginView Other Login Controls Membership API Membership MembershipUser Membership Providers AccessMembershipProvider SqlMembershipProvider Other Membership Providers Membership Data Access SQL Server Other Data Stores
Configuration • Administrative tools • ASP.NET MMC snap-in • Web Site Administration Tool (Webadmin.axd) • Configuration API • Read/write access to configuration settings • Simplified custom configuration sections • Instrumentation • Perf counters, health monitoring, and more
Web Parts • Framework for building portal-style apps • Patterned after SharePoint Portal Server • System.Web.UI.WebControls.WebParts • Rich UIs with minimal code • Edit page layout using drag-and-drop • Edit appearance and behavior and more • Seamless personalization • Intercommunication ("connections")
Web Parts Chalaivate Pipatpannawong Chalaivate.COM
What's New in Mobility • Unified Control Architecture • Adapters enable pages and controls to render markup for different device types • WML adapters provided by third parties • Device filters <asp:Label Text="Hello, world" RunAt="server" Nokia:Text="Hello, Nokia" Up:Text="Hello, OpenWave" /> OpenWave browsers Nokia browsers
What's New in Localization • Auto-culture handling • Declarative mapping of Accept-Language headers to relevant thread properties • Simplified resource handling • Declarative mapping of control properties to resources using <%$ … %> expressions • Strongly typed programmatic resource loading • <asp:localize runat="server"> and more
What's New in Compilation • Autocompile anything • CS files, VB files, RESX files, and so on • Simply drop files into special directories • Extensible with custom build providers • New code-behind model (code-behind 2.0) • Fixes fragilities in version 1 • Relies on partial class support in compilers • Precompile and deploy without source
Dynamic Compilation vroot CS VB Code Files auto-compiled on first access WSDL XSD Resources RESX RESOURCE
Cross-Page Posting • Pages can now post back to other pages • Relevant properties: • control.PostBackUrl - Identifies postback target • Page.PreviousPage - Returns reference to page that originated a cross-page postback • PreviousPage.IsCrossPagePostBack - Reveals whether a cross-page postback occurred • @ PreviousPageType directive provides strongly typed access to previous page
Posting Back to Another Page <html> <body> <form runat="server"> <asp:TextBox ID="Input" RunAt="server" /> <asp:Button Text="Test" PostBackUrl= "PageTwo.aspx" RunAt="server" /> </form> </body> </html>
Referencing a Control on the Previous Page (Weak Typing) <html> <body> <asp:Label ID="Output" RunAt="server" /> </body> </html> <script language="C#" runat="server"> void Page_Load (Object sender, EventArgs e) { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) { TextBox input = (TextBox) PreviousPage.FindControl ("Input"); Output.Text = "Hello, " + input.Text; } } </script>
Referencing a Control on the Previous Page (Strong Typing) <%@ PreviousPageType VirtualPath="~/PageOne.aspx" %> <html> <body> <asp:Label ID="Output" RunAt="server" /> </body> </html> <script language="C#" runat="server"> void Page_Load (Object sender, EventArgs e) { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) Output.Text = "Hello, " + PreviousPage.InputBox.Text; } </script> Public property wrapping TextBox
Validation Groups • Validation controls can now be grouped using new ValidationGroup property • Implemented by validation controls • Also implemented by Button, LinkButton, and ImageButton controls • Allows page to post back when validators in target group are satisfied • Fixes deficiency in ASP.NET 1.x
Validation Groups Chalaivate Pipatpannawong Computer Instructor www.9Expert.co.th chalaivate@9expert.com
Client Callbacks • "Lightweight" postbacks • Client-side callback manager transmits asynchronous XML-HTTP requests to server • Server receives and processes the request, but does not rerender the page • Callback manager receives the response and notifies the client via registered callback • Requires Internet Explorer 5.0 or higher • Great way to improve UI responsiveness
How Client Callbacks Work Client Server 1 2 Client Callback Manager Page Client initiates callback by calling function returned by GetCallback-EventReference Callback manager launches async XML-HTTP call to server 3 Page's RaiseCall-backEvent method is called 5 4 Client is notified that the call completed and handed the result Callback manager is notified that the call completed
Who's Got the Focus? • In ASP.NET 1.x, client-side script was needed to assign focus to a control • In ASP.NET 2.0, use Page.SetFocus <asp:TextBox ID="UserName" RunAt="server" /> . . . <script language="C#" runat="server"> void Page_Load (Object sender, EventArgs e) { SetFocus ("UserName"); } </script>
Connexion au compte
Connectez-vous pour publier votre contenu sur SlideServe.