AJAX Web Development Using .Net 2.0
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


AJAX Web Development Using .Net 2.0






Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • A student asked a question about how to maintain separate web.config files across Dev, Test, and Production environments Another student asked about possible ways to layout controls on a form Another student mentioned that we should discuss Javascript debugging. A link to an article describing this is included at the end of the presentation. We also will further into this when we discuss AJAX next week. MVC is a well known software architecture design pattern. Stands for Model View Controller. Based on the book by Gamma, Helm, Johnson, and Vlissides. Microsoft has an implementation of it. A student asked some questions about when to use it and should they use it. I included a link at the end of this presentation that describes Microsoft’s implementation of it. The link is also posted on our classes collaborative site. .Net MVC is an alternative – not a replacement for webforms
  • Walkthrough – begin and end projects In exercise 1, we created several new styles using the CSS designer In exercise 2 , we bound a gridview control to a LINQ to SQL class. In exercise 3, we added listview and datapager controls to add paging
  • We used a LINQDataSource in last week’s optional homework
  • Two sets of standard query operators. One operates on objects of type Ienumerable and the other operates on objects of type Iqueryable
  • LINQ is currently integrated directly into the native syntax for both C# 3.0 and VB 9.0 – which are included with Visual Studio 2008 Other languages may also support Language Integrated Query syntax in the future. There are many flavors of LINQ which we describe by the type of data it operates over. As you can see here, LINQ may operate over Objects, SQL, Datasets, and XML. These are the four flavors of LINQ that we are shipping with the .NET Framework 3.5 LINQ to Objects SQL-like queries for any .NET collection (or anything that implements the Ienumerable or Iqueryable interfaces) The LINQ to Objects API supports queries over any .NET collection, such as arrays and generic lists. This API is defined in the System.Linq namespaces inside System.Core.dll LINQ to objects is enabled by including the System.Linq namespace. Manipulating collections of objects, which can be related to each other to form a hierary or a graph. From a certain point of view, LINQ to Objects is the default implementation used by a LINQ query. LINQ to SQL Query enabled data access framework LINQ to XML Query enabled, smaller, faster XML DOM The important thing to remember is that the querying syntax used in LINQ is consistent regardless of the type of data you’re working with. There are also 3 rd party implementations of LINQ such as LINQ to Sharepoint and LINQ to Nhibernate (JAVA OR Mapper)
  • Automatic properties provide us with a shorthand method for defining a new property. The C# compiler generates to get and set. Initializers reduce the amount of work it takes to create a new instance of a class Local variable type inference allow the C# or VB .Net compiler to determine the type of a variable at compile time We can create a type on the fly

AJAX Web Development Using .Net 2.0 Presentation Transcript

  • 1. Building Effective Web Applications with ASP .Net 3.5 Noah Subrin SRA University Fall 2008 Week 2
  • 2. Today’s Agenda
    • Student Q&A
    • Week 1 Optional Homework Review
    • Data Access
    • Data bound controls
    • DataSources
    • LINQ to SQL
  • 3. Student FeedbackQ&A
    • Please feel free to post questions and discuss development questions on our class collaborative site on the SRA portal
    • Web.config files in multiple environments
    • Layout of controls on web forms
    • JavaScript debugging
    • Traditional .Net Framework development vs. .Net MVC
  • 4. Optional Homework – Virtual Lab or VS2008 Training Kit
    • Also can be found as part of VS2008 Training Kit Lab “Building Web Applications with VS2008”
    • Use the CSS designer to create new styles
    • Create an image summary page using LINQ classes
    • Add ListView and DataPager controls and add paging
  • 5. Overview of Data Access (Chapter 8)
    • 99.99% of apps involve some type of data
    • We can use data bound controls to generate our web application’s UI
    • SQL Server Express is a royalty free database included with VS2008 or Visual Web Developer.
  • 6. Types of Data bound Controls p337
    • Lists
    • Tabular
    • Hierarchical
  • 7. Bind Controls to a DataSource p350
    • SQLDataSource
    • LinqDataSource
    • AccessDataSource
    • ObjectDataSource
    • XmlDataSource
    • SiteMapDataSource
  • 8. Data Driven App Demos
    • Code From Chapter 8
    • Add/Configure a SQLDataSource
    • List Controls
    • Tabular
    • Hierarchical Data
    • This demo uses an xml file as a data source.
    • CRUD Sample – Employee Directory
  • 9. Break
    • We will look discuss LINQ after break
  • 10. What is LINQ?
    • LINQ stands for Language Integrated Query
    • A general purpose query facility to query relational data, XML data, objects/collections.
    • New in .Net Framework 3.5 – must target .Net Framework 3.5
    • Based on standard query operators
    • LINQ query syntax resembles backwards SQL statements
  • 11. LINQ Architecture .NET Language Integrated Query C# 3.0 VB 9.0 Others… LINQ to Objects LINQ to SQL LINQ to XML LINQ to DataSets Objects <book> <title/> <author/> <year/> <price/> </book> XML Relational
  • 12. Benefits of Using LINQ
    • May not need to build an entire DAL (data access layer)
    • Much easier to query XML – don’t have to use Xpath
    • Work with data in a consistent way – whether it is SQL Server data, XML data, ADO .Net dataset, an object collection, or data in memory
    • Offers compile time checking, autocompletion, and Intellisense
  • 13. New C# Language Features that Support LINQ p902
    • Automatic properties
    • Initializers
    • Type Inference
    • Anonymous types
  • 14. Three Parts of a LINQ Query
    • Obtain the data source
    • Create the query
    • Execute the query
  • 15. What’s a DataContext?
    • The DataContext is the source of all entities mapped over a database connection
    • It tracks changes that you made to all retrieved entities and maintains an &quot;identity cache&quot; that guarantees that entities retrieved more than one time are represented by using the same object instance.
  • 16. LINQ Demos from MSDN Library Help Files
    • How to: Query an ArrayList with LINQ
    • LINQ to XML vs. DOM
    • Paste as XML C# Addin
  • 17. C# Building the Paste Xelement as XML Addin
    • http://www.hanselman.com/blog/PasteXMLAsXLinqXElementVisualStudioAddIn.aspx
  • 18. Creating LINQ to SQL Entities
    • Building Entities with the Object Relational Designer p922
    • Using the LINQDataSource control
    • p926
  • 19. Other MVC Resources
    • MSDN Virtual Lab on Introduction to .Net MVC
    • Discussion of .Net MVC can be found on www.asp.net/mvc/
    • Book - Design Patterns by Gamma, Helm, Johnson, and Vlissides
  • 20. Other LINQ resources
    • www.thinqlinq.com
    • Book – LINQ in Action
    • Msdn.microsoft.com articles on LINQ
  • 21. More on JavaScript Debugging
    • Scott Guthrie’s blog
    • http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-debugging.aspx
  • 22. Optional Take Home Class Exercise
    • Do any one of the following:
    • MSDN Virtual Lab “Using LINQ to SQL with the .Net Framework 3.5 and Visual Studio 2008” Event ID: 1032376015 (msevents.microsoft.com)
    • Download lab manual from #1, install Northwind database and do lab on your pc.
    • Do VS2008 Training Kit Lab “LinqToSql”
  • 23. Next Week
    • Week 2 Q&A
    • Homework Review (Take home lab)
    • Chapters 31-33 (AJAX)
  • 24. Questions ?
    • Feel free to contact me at [email_address]
    • Please use the class portal site on the SRA portal to post question or other discussions that may be of interest to the class.
    • Thank you!