Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASP. NET Differences Dave Webster EMEA Technical Team dave

Similar presentations


Presentation on theme: "ASP. NET Differences Dave Webster EMEA Technical Team dave"— Presentation transcript:

1 ASP. NET 2. 0 - Differences Dave Webster EMEA Technical Team dave
ASP.NET Differences Dave Webster EMEA Technical Team blogs.msdn.com/davewebster Microsoft Corporation

2 Who are you? ASP 2.0 ASP Classic? PHP? ASP 1.1? Ruby on rails?
Cold Fusion?

3 Overview The good and bad with Classic ASP (and PHP)
Introduction to Microsoft® ASP.NET Key changes from ASP to ASP.NET Applications that use databases ASP to ASP.NET compatibility FAQ An introduction to Atlas

4 What do you like about… ASP Classic/PHP? Its free Lots of samples
4/26/2017 What do you like about… ASP Classic/PHP? Its free Lots of samples Deployment is easy Your existing code just works Living community

5 What don't you like about…
4/26/2017 What don't you like about… ASP/PHP Not type safe Spaghetti code Error prone Security risks? Code base may be old and vulnerable (esp. ASP) Can't reuse skills Not object Oriented (ASP earlier PHP) Lots of code (even if it's someone else's) PHP Best editors are not free Problems with the old. Way. From the last slide you can say that the code only just works. Points: Not type safe. This is OK until things go wrong or the app gets large. What do I use this variable for? Spaghetti code. Its not your fault that your apps became this way, it’s the way the environments encouraged you to code. But it gets harder to maintain, you make mistakes which the compiler does not catch. These errors are subtle and expensive to fix. Security. Your app is based on a body of someone else’s code. How current is it? How robust against the newer forms of attack. Skill reuse. Limited to where you can use your PHP skills and ASP skills. Cant build a winform or Office addin easily for example. Not OO. Lots of code to do simple things. Even if you just copied and modified the code you still need to manage it. PHP Editor. For real development you need to spend money. PHP is not free. Finding functions in PHP can be hard. They are inconsistent in naming and function ahd in one lump..

6 What concerned you about previous versions of ASP.Net?
Requires learning a new language VB.Net looks different All the samples are in C# Everything was compiled into a single binary Deployment is difficult Its expensive just to evaluate it Needs IIS on the machine – can’t use at home or at work VB.Net is an evolution of VB However it is right that there are some new things in the language to learn. The good news is that there is much less code in a modern ASP.Net applicatoin, as the demo in a few minutes will show. All the samples in C#. All MSDN samples are in both VB.Net and C#. However we are sorry that most samples in demos and presentations are in C#. VB.Net is an equal language in .Net as good as C#. Single binary. The audience may have seen ASP.Net 1.x and not liked the cycle or build and test. Show in the demo how to save and refresh the browser. 6 6

7 Enter Asp.Net 2.0 Requires learning a new language
VB.Net looks different it’s still VB All the samples are in C#. Now also in VB.Net. No compile step necessary, save and refresh Deployment is easy Express edition is free Comes with its own limited Web Server VB.Net is an evolution of VB However it is right that there are some new things in the language to learn. The good news is that there is much less code in a modern ASP.Net applicatoin, as the demo in a few minutes will show. All the samples in C#. All MSDN samples are in both VB.Net and C#. However we are sorry that most samples in demos and presentations are in C#. VB.Net is an equal language in .Net as good as C#. Single binary. The audience may have seen ASP.Net 1.x and not liked the cycle or build and test. Show in the demo how to save and refresh the browser. 7 7

8 Instantiate, process, and render
ASP.NET Request Flow Generate ASPX engine Parse Request Instantiate Request Instantiate, process, and render Response Page class Response 8

9 ASP.NET Programming Models
Two types of programming models exist ASPX page only: contains HTML, control tags, and code Code-behind model: ASPX file contains HTML and control tags, and a code-behind file contains code A true separation between code and content One File Two files. (code-behind model) Page.aspx Page.aspx Page.aspx.vb <Tags> + Code <Tags> Code

10 Visual Studio 2005 C# Express VB C++ J# Web
4/26/2017 7:24 AM Visual Studio 2005 Testers Visual Studio Team System Visual Studio Team Architect Edition Team Developer Edition Team Tester Edition Architects Enterprise Devs Consultants Microsoft Visual Studio Professional Edition Professionals Part-Timers Hobbyists Students C# Express VB C++ J# Web Enthusiasts Novices © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

11 Demo Hello world Controls Accessibility Localization
Create a simple page with a table and a calendar control. Use code behind or infile. Add a calendar control to a table cell, investigate its properties and the quick format option. Add a label and a text box. Show that the properties are now the same for ‘text’ rather than ‘text’ and ‘caption’. Change the browser language to be the local language (or something like Chinese-China). . Add Culture=“auto” to the top of the markup. Refresh the browser and notice the difference. Notice how little code you need to do things. If time: Add a label saying ‘the time is’ add another label. Add code to set the current time to the second label

12 ASP.NET Features Life made easy for developers
Visual Studio designer support, rich server controls, and base class library support Write code in the language of your choice Structured error handling Great debugging and tracing support

13 ASP.NET Features Performance, scalability, and reliability
Compiled code means speed Cache APIs to improve performance and scalability Built-in support for Web farms and Web gardens Nonstop availability and protection against deadlocks, memory leaks, and so on

14 ASP.NET Features Easy deployment Xcopy deployment Don’t need FPSE
Dynamic updates without interrupting the service – use FTP No more registry! Use XML-based configuration files More control with the new security model Flexible session state management Many other new features

15 Application Configuration Changes
ASP.NET application settings are stored in XML configuration files Types of configuration files Machine.config Contains machine-wide settings Web.config Contains project- and application-wide settings Easy programmatic access to the data in these files

16 Security Related Changes
The IIS part of the security remains same Use security sections in the configuration files New authentication modes Windows, Forms, None Authorization modes permit you to control access to resources: File authorization URL authorization Permit and deny users access to the application

17 VBScript vs. Visual Basic .NET
No VBScript in ASP.NET — it’s all Microsoft Visual Basic® .NET! Visual Basic language changes Option Explicit is now the default No more “Variant” type — use type “Object” Method and function calls with parameters now require parentheses, so change: <% Response.Write "Hi" %> to <% Response.Write ("Hi") %> By default, arguments are passed by value Value types and reference types Arrays are now zero based

18 Visual Basic Language Changes
Let and Set are not supported, so change: Set MyObj1 = MyObj2 to MyObj1 = MyObj2 No more default properties (except for indexed properties), so change: MyString as string = Textbox to MyString as string = Textbox.Text 18 18

19 Visual Basic Language Changes
Integer data type is now 32 bits and a Long data type is 64 bits Use structured error handling (Try-catch block) instead of OnError (OnError still works) Must cast data types explicitly: Response.Write ("Count=" & CStr(MyCount)) or Response.Write("Count=" & CType(MyCount, String))

20 Visual Basic Language Changes
Must have spaces around “&” while doing string concatenation, so change: x = str1&str2 to x = str1 & str2 Property Get, Property Set, and Property Let are not supported anymore, so instead use: Public Property MyCount as Integer Get MyCount = InternalValue End Get Set InternalValue = value End Set End Property

21 Demo VB Language Changes
Show the public property syntax. See how the code is generated for you. Show how let and set disappear but are enterable. Show List(of) generics Page events Load, PreInit etc

22 Applications that Use Databases
Data access changes ADO and ADO.NET are quite different ADO.NET is not exactly backward compatible Three main objects in ADO.NET: DataSet, DataReader, and DataAdapter Two built-in managed data providers: SQLClient and OLEDB Built-in designer support for ADO.NET objects in Visual Studio .NET Can be code free

23 ASP to ASP.NET Compatibility FAQ
Do I need to write code for different browsers? No – ASP.NET produces HTML 3.2 compliant output Can I still use ADO from ASP.NET? Yes – you can use ADO through Interop, but ADO.NET is preferred

24 Demo Atlas Show the public property syntax. See how the code is generated for you. Show how let and set disappear but are enterable. Show List(of) generics Page events Load, PreInit etc 24

25 ASP.NET Resources ASP.NET Quick Start Tutorials
Authentication in ASP.NET Security ASP.NET Security Session State in ASP.NET ASP.NET Configuration


Download ppt "ASP. NET Differences Dave Webster EMEA Technical Team dave"

Similar presentations


Ads by Google