390 likes | 562 Views
Napredak u web development svetu kroz Visual Studio 2010. Zlatko Knežević Evanđelista za razvojne tehnologije zlatko.knezevic@microsoft.com http://msforge.net/blogs/blackdwarf/ . Agenda. ASP.NET podržava nekoliko vrsti aplikacija. ASP.NET Web Forms. ASP.NET AJAX. ASP.NET MVC.
E N D
Napredak u web development svetukroz Visual Studio 2010 Zlatko Knežević Evanđelista za razvojne tehnologije zlatko.knezevic@microsoft.com http://msforge.net/blogs/blackdwarf/
Agenda ASP.NET podržava nekoliko vrsti aplikacija ASP.NET Web Forms ASP.NET AJAX ASP.NET MVC ASP.NET Dynamic Data ASP .NET Framework .NET Framework Change the Rules
ASP.NET Web Forms ASP.NET Web Forms 4.0 vam omogućava da napravite web aplikacije sa daleko bogatijim korisničkim iskustvima Change the Rules
ASP.NET Web Forms Fokus na developera koji voli kod • Voli da ručno piše HTML kod • Piše JavaScript kod • Želi da kontroliše svaku uglastu zagradu i piksel Change the Rules
ASP.NET Web Forms Sa verzijom 4.0, vi imate kontrolu: • Renderovanje kontrola • View State • Controls IDs • Website URLs • XHTML i Accessibility Change the Rules
FormView poboljšanja <asp:FormView ID="FormView1" runat="server" RenderOuterTable="false"> Change the Rules
ListViewpoboljšanja <asp:ListView ID="ListView1" runat="server"> <LayoutTemplate> <div id="itemPlaceHolder" runat="server” /> </LayoutTemplate> <ItemTemplate> <li><%# Eval("Title") %></li> </ItemTemplate> </asp:ListView> Change the Rules
Kontrolišite ViewState Control.ViewStateMode • Enable • Disable • Inherit (default) Change the Rules
Kontrolišite ID-eve na klijentu Control.ClientIdMode • AutoID • Static • Predictable • Inherit (default) Change the Rules
Kontrolišite ID-eve na klijentu <system.web> <pages clientIDMode="Predictable"> </pages> </syetm.web> Change the Rules
ASP.NET Routing i SEO Umesto: http://YourSitecom/Search.aspx?query=cats Lepše je da koristite: http://YourSite.com/Search/cats Change the Rules
Ostala poboljšanja za SEO • Page.MetaDescription • Page.MetaKeywords • Response.RedirectPermanent(new url) Change the Rules
QueryExtender kontrola • Radi sa EntityDataSource i LinqDataSource • Omogućava lako filtriranje rezultata iz baze podataka • Podržava različite tipove filtera: • Search • Range • Property • Custom Change the Rules
ASP.NET Chart kontrola • <asp:ChartControl ../>je sada ugrađena
ASP.NET 4 upravljanje i bezbednost • Output/Object cache ekstenzibilnost • Keširanje na disku • Integracija sa „Velocity“-jem (AppFabric) • Pre-load, pre-cache na startu aplikacije • Posmatranje performansi po aplikaciji • Html i Url enkodovanje ekstenzibilnost • Nova sintaksa za HTML enkodovanje <%:Message %>
ASP.NET Web Forms Change the Rules
ASP.NET AJAX ASP.NET podržava nekoliko vrsti aplikacija ASP.NET Web Forms ASP.NET AJAX ASP.NET MVC ASP.NET Dynamic Data ASP .NET Framework .NET Framework Change the Rules
Česti mitovi • ASP.NET AJAX je usko vezan za ASP.NET i web forme • Morate da koristite ScriptManager i UpdatePanel dabiste bilo šta uradili • Zahteva Visual Studio da bi radio... Change the Rules
ASP.NET AJAX Server-Side AJAX AJAX Control Toolkit Client-Side AJAX jQuery Change the Rules
Server vs. Client AJAX Server AJAX Rendering Rendering Initial request: HTML Form POST HTML Client AJAX HTML + JSON JSON JSON Change the Rules
ASP.NET AJAX Server bi trebalo da se brine o podacima, ne reprezentaciji Change the Rules
ASP.NET AJAX • Client-Side Templates • Client-Side Controls • Client-Side Data Binding • Read/Write Database Data from the Browser • Cross-Browser Compatible • Nijve vezan za ASP.NET Client-Side AJAX Change the Rules
ASP.NET MVC ASP.NET podržava nekoliko vrsti aplikacija ASP.NET Web Forms ASP.NET AJAX ASP.NET MVC ASP.NET Dynamic Data ASP .NET Framework .NET Framework Change the Rules
MVC = Model-View-Controller Controller (Input) View (Presentation) Model (Logic) Separation of concerns!
Kako MVC izgleda? Controller Controller Zadužen za ulaz (HTTP requests) Request View View Vizuelna reprezentacija modela Response
Nove stvari u MVC2 • “Mala“ unapređenja • Areas • Validacija • Strongly typed helpers • Templated helpers Change the Rules
“Mala”?? • RenderAction() pomoćni metod • Povećava kompozibilnost aplikacija • Držite logiku tamo gde pripada • Lakše testiranje određenih vrsta scenarija Change the Rules
Druga „mala“ unapređenja • Bezbednost • HTML Encoding Syntax • <%:Model.NewPostByEvilPerson%> • Works with ASP.NET 4 • JsonResult • Unapređenje performansi • Asynchronous Controller Actions • Olakšanja u radu • Default Parameters for Controller Actions • HttpPost, HttpGet, RequiresHttps • Value Providers
Areas • Kako da obezbedite „površine“ za rad u aplikaciji? • Grupiše kontrolere, modele i view-ove u „površine“ • Podrška u Visual Studio alatima Change the Rules
Validacija • Podrška za anotacije (DataAnnotations) • Podrška za druge provajdere za validaciju • Data Annotation (Default) • Enterprise Library • XML • Šta god drugo da želite... • Počnite da anotirate na modelu na serveru… • …i onda pustite da se „spusti“ do klijenta Change the Rules
Templated helpers • Kako da lako i deklarativno kažete MVC-u da prikaže vaš model? Display Helper Methods • Html.Display() • Html.DisplayFor() • Html.DisplayForModel() Edit Helper Methods • Html.Editor() • Html.EditorFor() • Html.EditorForModel()
Overview of Talk ASP.NET podržava nekoliko vrsti aplikacija ASP.NET Web Forms ASP.NET AJAX ASP.NET MVC ASP.NET Dynamic Data ASP .NET Framework .NET Framework Change the Rules
Dynamic Data produktivnost • Uključite ih u postojećoj aplikaciji • <asp:GridView/>, <asp:DetailsView/>, <asp:FormView/> <asp:ListView/> • Automatski templejti i podrška za validaciju • Dobijate scaffolding veoma lako • O istom trošku... • Templejti • Novi templejti za entitete • Templejti za filtere • Novi templejti za URL, enumeracije • Više opcija za prikaz u DisplayAttribute • Podrška za nasleđivanje i više-na-više relacije
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Visual Studio, the Visual Studio logo, and [list other trademarks referenced] are trademarks of the Microsoft group of companies. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. 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.