1 / 16

Introducing ASP+

Introducing ASP+. Scott Mitchell mitchell@4guysfromrolla.com http://www.4GuysFromRolla.com/ http://www.ASPMessageboard.com/ http://www.ASPFAQs.com/. Static Web Pages. Dynamic Scripts. Distributed, Compiled Programs.

cheryl
Download Presentation

Introducing ASP+

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introducing ASP+ Scott Mitchell mitchell@4guysfromrolla.com http://www.4GuysFromRolla.com/ http://www.ASPMessageboard.com/ http://www.ASPFAQs.com/

  2. Static Web Pages Dynamic Scripts Distributed, Compiled Programs Content was static. To alter the look and feel of a Web page, a programmer had to physically alter the contents of the page itself. The static nature of the Web at this time removed any possibility of a user interacting with a Web site or interaction among Web sites. Performance was great and development easy, but the Web lacked any real usability. Dynamic scripts allowed for user interaction with a Web site. Web content could be dynamically generated based on a number of variables, such as user input. Allowed for the Web to serve as an application medium. Development was anything but easy. The scripting nature of development led to poor programming practices and “messy” code. Also, interaction among Web sites was possible, but limited and difficult. Web pages are actual, programs created using object-oriented programming techniques. These programs are compiled instead of interpreted like the scripts of the past. A focus on Inter-Web server communication allows developers to build truly distributed applications on the Web. The Evolution of the Web

  3. Problems with ASP Today • Nasty code - content and code are helplessly mixed as code snippets are sprinkled around HTML blocks. • Deploying an ASP application is difficult, potentially requiring setting changes to the IIS metabase and registration of various COM components. • Common tasks, such as server-side form validation, displaying database results, caching data, user authentication, uploading binary files, etc., are difficult. • Scripting languages offer poorer performance and encourage more spaghetti-like code than their compiled counterparts. • Terrible (terrible!!!) debugging support…

  4. ASP+ to the Rescue! • ASP+ pages are created with the syntax of modern, compiled programming languages - either VB (not VBScript), JScript.NET, C#, or others. • The registry is no more. Components no longer need to be registered. Deployment is as simple as XCOPY • ASP+ provides several, customizable, server-side controls for common tasks: validation, file upload, database display, etc. • ASP+ provides mechanisms for inter-Web server communication, regardless of the Web server or platform. • Exceptional debugging tools and options.

  5. The Makeup of ASP+ ASP+ Web Pages ASP+ Web Services ASP+ Application Layer

  6. ASP+ Web Pages • These serve the same purpose as ASP pages today: a dynamic Web page users can visit via the Internet. • ASP+ pages have a .aspx extension, and are text files, just like ASP pages. In fact, they can be created to look remarkably like ASP. (Show demo1.aspx…) • ASP+ pages do not support VBScript. Rather, pages are created with full-blown VB 7 (or JScript.NET or C#).

  7. Changes from VB6 to VB7 • No more default properties for objects: objRS(“columnName”) will generate an error, must use: objRS.Fields(“columnName”).Value • As a consequence, Set and Let are no longer supported. • All calls to subroutines must have parenthesis • Variables can be dimensioned and initialized simultaneously: Dim i as Integer = 4 • Error handling now uses Try … Catch … Finally blocks as opposed to On Error Goto. • VB7 is (finally) a real OOP language. Now possible to use polymorphism and true inheritance.

  8. Changes from ASP Coding Styles to ASP+ Coding Styles • All functions and subs must exist in <SCRIPT RUNAT=“server”> blocks (functions cannot exist in the inline code (<% … %>)). • ASP+ design encourages use of post-back forms • ASP+ offers server controls. These controls provide an object model developers can program against. • ASP+ pages are designed to be event-driven as opposed to procedural-based.

  9. ASP+: Write Less Code • Collecting and acting on user input… a comparative look at ASP and ASP+ (create/run demo) • Note the use of HTML server controls in the ASP+ page. These are created by adding the runat=“server” property to standard HTML tags… • Note that we can wire up events in the server controls

  10. Server-Side Validation Example • With ASP, server-side validation was oft-repeated and a ton of code… • ASP+ introduces a number of Validation controls to ease the task of validating form input. • Show ValidationDemo.aspx • For more info, visit: http://www.4guysfromrolla.com/webtech/090200-1.shtml

  11. SERVER CLIENT XML XML XML SERVER SERVER XML XML HTML CLIENT SERVER XML XML Web Services: Inter-Server Communication

  12. Creating Web Services with ASP+ • Creating Web Services with ASP+ is as simple as creating a class (show Math.asmx demo). • Web service files have an .asmx extension. • ASP+ creates a default description page for a given .asmx file (show demo by visiting http://localhost/aspugtalk/Math.asmx). • An .asmx files SDL (service description language) can be viewed by visiting the .asmx file and appending ?sdl to the QueryString.

  13. Inter-Server Communication SERVER RECEIVING COMMUN- ICATION REQUEST SERVER INTIATING COMMUN- ICATION Via HTTP Protocol, a Discovery request is sent (DISCO) Server returns Service Description Language (SDL), describing Web service Sends SOAP Request in format specified in SDL Sends SOAP Response, communications complete

  14. Calling a Web Service from an ASP+ Page • A proxy class must be created based on the Web service’s SDL. This task can be automated by WebServiceUtil.exe (show Proxy class creation demo) • This proxy class must then be compiled into a DLL (show compilation of proxy class) and moved into the \bin directory • The Web service can then be accessed programmatically from an ASP+ page (demo: show AccessMathProxy.aspx)

  15. In Conclusion... • ASP+ is an entirely new way to create interactive, distributed Web applications. • ASP+ enables developers to write more powerful applications with fewer lines of code. • ASP+ addresses many of the disadvantages of ASP. • ASP+ Web services allow for developers to create truly distributed applications running over standard protocols.

  16. To Learn More about ASP+ • Download the pre-beta bits at: http://msdn.microsoft.com/net/ • Pick up a copy of Wrox’s A Preview to ASP+(Anderson, Homer, Howard, and Sussman) • Visit the many great ASP Web sites: 4GuysFromRolla.com, ASPFree.com, ASP101.com, ASPNG.com • Have your ASP+ Questions Answered at: ASPMessageboard.com, ASPLists.com

More Related