Tag Archives: AJAX

SCREENCAST: Rendering Polygons from SQL Server 2008 on Virtual Earth

In this screencast, I build off of the concepts shown in my previous screencast and show you how to render a polygon on a Virtual Earth map using REST, Windows Communication Foundation (WCF), LINQ to SQL, and the new geography data type in SQL Server 2008.

To learn more about the GeoRSS utility library, visit:
http://blogs.msdn.com/eugeniop/archive/2008/07/01/simple-georss-utility-library-released.aspx

A big thanks to Eugenio Pace for letting me use it as part of my sample!

Screencast:

https://channel9.msdn.com/posts/keydet/Rendering-Polygons-from-SQL-Server-2008-on-Virtual-Earth/

Code:

http://cid-1f72da7294089597.skydrive.live.com/embedrow.aspx/Public/Virtual%20Earth/VeWcfSql08

SCREENCAST: Saving Virtual Earth Polygons to SQL Server 2008

In this screencast, I show you how to draw a polygon on a Virtual Earth map and save it using ASP.NET AJAX, Windows Communication Foundation (WCF), LINQ to SQL, and the new geography data type in SQL Server 2008.

Screencast:

https://channel9.msdn.com/posts/keydet/Saving-Virtual-Earth-Polygons-to-SQL-Server-2008/

Code:

http://cid-1f72da7294089597.skydrive.live.com/embedrow.aspx/Public/Virtual%20Earth/VeWcfSql08

WEBCAST RECORDING: Adding Mapping Capabilities to your Applications with Virtual Earth and ASP.NET AJAX

First, let me apologize since I promised to make this recording available almost two months ago.  I was trying to get the recording uploaded to the same Live Meeting servers as my other webcasts.  Needless to say, I had some challenges.  I decided to upload it to Silverlight Streaming.  I had to split the presentation into two files since this is a 90 minute presentation and Silverlight Streaming has file size limits.

In this presentation, I show you the fundamentals of the Virtual Earth Map Control 6.1 using JavaScript.  Then, I show how you can use ASP.NET AJAX and the Windows Communication Foundation (WCF) to make building Virtual Earth solutions easier.  Finally, I show you how you can host Virtual Earth in a desktop application.

Part I:

[Double click the video to view full screen]

http://silverlight.services.live.com/invoke/21188/ve6.1webcast_part1/iframe.html

Click here to download Part I wmv

Part II:

[Double click the video to view full screen]

http://silverlight.services.live.com/invoke/21188/ve6.1webcast_part2/iframe.html

Click here to download Part II wmv

So what’s the benefit of this recording?  First, it is much higher quality than the Live Meeting recording since I used Camtasia Studio.  Second, the content is updated to use the Virtual Earth Map Control 6.1 and the Virtual Earth JavaScript Intellisense Helper.  Finally, since it’s hosted using Silverlight Streaming, you don’t have to register to view it. 

Here are some download links for the webcast:

Deck: http://cid-1f72da7294089597.skydrive.live.com/embedrow.aspx/Public/Virtual%20Earth/marcscVEProgramming.pptx

Code: http://cid-1f72da7294089597.skydrive.live.com/embedrow.aspx/Public/Virtual%20Earth/VEMapControlDemo|_v6.1|_VS2008.zip

The sample demonstrating hosting Virtual Earth in a Windows Presentation Foundation (WPF) is old.  I have an updated sample.  Details about the updated sample are available at http://blogs.msdn.com/devkeydet/archive/2008/06/24/wpf-and-virtual-earth-revisited.aspx.  You can also watch a screencast about the updated sample at https://channel9.msdn.com/posts/keydet/Using-Virtual-Earth-in-a-WPF-Application/

Technorati Tags: ,,,,

FOLLOW UP: Public Sector Developer Conference (Nashville, TN)

Thanks to everyone who attended.  Sorry about the overflow into the hallways.  There was much less dropoff between registration and attendance than we normally see.  Some of the content isn’t published yet.  Once it is, we’ll make sure to update this post with the appropriate links.

Building Rich Internet Applications Using Microsoft Silverlight 2

Building WPF Applications in Visual Studio 2008 and Expression Blenddeck, code

Data Access with Language Integrated Query

Overview of the .NET Framework 3.5 SP1 & ASP.NET MVC – deck, code

We also mentioned some downloadable tools that folks were interested in using.  Here are the ones I remember:

Visual LINQ (to SQL) Query Builder

LINQPad

If I forgot one, please let me know by posting a comment and I will update the post.  Thanks!

Marc

FOLLOW UP: Public Sector Developer Conference (Downers Grove, IL)

Thanks to everyone who attended!  Here are the links to the decks and code for the sessions.  I don’t have the content from the LINQ & VSTO sessions yet, but will update this post when I get them.  However, I did promise to have a post up this morning.

How Visual Studio Team System 2008 will benefit your organization?deck

Language Integrated Query (LINQ)

Overview of the .NET Framework 3.5 SP1 & ASP.NET MVCdeck, resources, code (links to a post explaining how to get the code I based me demos on)

Office Development with VSTO  and Office Open XML Format

If you are interested in other content, I have a list of recorded webcasts in My Recorded Webcasts list.  There is a session similar to Joel’s LINQ session that covers LINQ to SQL in a little more detail as well as other topics which might interest you.  You might want to check out My Screencasts as well. 

Free training on .NET 3.5 SP1

I just came across this update to the .NET 3.5 Enhancements Training Kit from Jonathan Carter.  If you’ve seen my ASP.NET 3.5 Extensions Preview webcast and are looking for the code, then you will want to download the kit.  I used the kit as the starting point for my demos.  I do a few things differently here and there, but most of it is because I didn’t have time to show everything in 90 minutes.  As far as I can tell, everything that was in the extensions preview is in 3.5 SP1 except ASP.NET MVC which will be shipped separately.  The training kit offers a great way to get your hands dirty with the new stuff in 3.5 SP1.  Go get it!  Oh yea, I have also updated the deck from my webcast to reflect the changes.  I have also added a couple slides about what’s new in WPF & WCF.  You can download my new 3.5 SP1 deck here.

UPDATED WORKAROUND: Intellisense for page level map variables using the Virtual Earth JavaScript Intellisense Helper

UPDATE: AH FOOEY!  I feel like a goof:).  Turns out my workaround DOESN’T WORK!!!  If you look at the logic from the original post, it makes sense that it wouldn’t work because “var map = new VEMap();” is before “var map = null;” and therefore you get Intellisense for null.  I swear it worked (giving me Intellisense for page level map variable in multiple functions) the first time I tested it.  I think I may have been a victim of the JavaScript Intellisense cache not having updated :(.  Nonetheless, I was so excited about it working, I jumped the gun with my original post.  Yes, I realize the last picture in the original post didn’t actually convey what I was trying to accomplish.  I showed the wrong scenario in my haste to get a blog post up.  Maybe if I would have shown the right scenario, I would have recognized the err of my ways:).  This entire post has been rewritten with my "plan B" workaround.

So I have been playing around with other approaches to the workaround described here.  The first thing I tried was:

image 

On the surface, this seemed like a reasonable workaround.  However, there were still some scenarios where JavaScript errors would pop up.  For example, switching to 3D mode would cause the map control to raise an error:

image 

A similar error would happen when you close the browser.  One could argue this annoyance is a small price to pay for JavaScript Intellisense for the map control:).  However, it is still very annoying.  Good news!  There’s a better workaround.  After fiddling with a bunch of ideas, I stumbled upon the following approach:

image

Everything JUST WORKS!  You get JavaScript Intellisense at design time and the map is null at run time until it is actually instantiated in pageLoad().  This makes for a nicer experience since you don’t have to put up with the annoying error messages or constantly comment/uncomment code to get Intellisense where you need it.  Of course, in production, you should replace the conditional logic with var map = null for your page level variable.

Interestingly enough, this approach works well in another scenario:

image

In this scenario you won’t get Intellisense for x above the if statement because Visual Studio does not perform return type analysis.  However, using the same trick, you can see that you get Intellisense after the if statement.  This makes life better in a number of scenarios.  However, it does litter your code a bit.  Use it at your discretion:).  One could write a little utility that scans .js files and removes these entries based on a regular expression.  Maybe we’ll look at writing something such a utility for our next release.

None of this is in the current release of the Virtual Earth JavaScript Intellisense Helper, nor is it in the updated code I recently blogged about at Updated Virtual Earth Map Control demo code.  However, I will get both updated in the coming days.  For the sample code, I will update the original blog post when I publish the updated code.  I will make sure we release a new version of the Intellisense helper with these changes soon.

Updated Virtual Earth Map Control demo code

UPDATE: I’ve updated the code to use the workaround described here.  If you downloaded this code before May 2nd, 2008 @ 7:30 PM EST, then you might download it again.  The URL is the same.

I’ve update my primary Virtual Earth (VE) map control demos. If you aren’t familiar with my VE demos, they are essentially all the samples from the Virtual Earth Interactive SDK redone in a Visual Studio solution. My directory structure maps almost identically to the steps treeview in the Interactive SDK:

 image image

Then, I sprinkle in a little ASP.NET AJAX and Windows Communication Foundation (WCF) where these technologies can make building VE solutions easier. All you have to do is download the zip and you basically have the Interactive SDK code++.

Here’s what’s new in the updated code:

  • All pages use the 6.1 map control.
  • Cleaned up some AJAX code that still used really old previews from ASP.NET AJAX (Specifically Microsoft.Web.Preview.dll & Sys.Preview.UI scripts from the Microsoft AJAX Library).
  • Additional code cleanup.
  • All JavaScript files use the Virtual Earth JavaScript Intellisense Helper.
  • All JavaScript files have a reference to their corresponding .aspx page so we get full Intellisense for the Microsoft AJAX Library and any other additional .js files referenced in the ScriptManager.
  • 05 – Customize Shapes/CustomizeShapes.aspx.js has an example of how to restyle the VE InfoBox using Cascading Style Sheets (CSS).
  • 07 – Import Data/GeoRSS_Collections_KML.aspx.js shows how to import KML.
  • 08 – Custom Tile Layers/CustomTileLayers.aspx.js correctly shows the custom tiles. The web site is now configured to use a fixed port for the ASP.NET Development Server.
  • 10 – Route and directions/RouteDirections.aspx.js uses map.GetDirections() instead of map.GetRoute() since map.GetRoute() is deprecated. I also added a multipoint routing example.

You can grab the code here:

http://cid-1f72da7294089597.skydrive.live.com/self.aspx/Public/Virtual%20Earth/VEMapControlDemo_v6.1_VS2008.zip 

WEBCAST FOLLOW UP: Overview of the Microsoft ASP.NET 3.5 Extensions Preview

Thanks to everyone who attended!  Sorry about the demo hiccups / going over.  As I mentioned in the beginning, I had a hard time trying to get everything I wanted to cover into 90 minutes.  As you can see, there’s quite a bit in the ASP.NET 3.5 Extensions.  Normally, I make all of my code demos available for download.  However, I used a newer build for my demos that’s not publicly available.  Once we release the new bits, I will make my code available.  For now, you can download my ASP.NET 3.5 Extensions deck here.

UPDATE: I just created a list of links on my Windows Live Space called ASP.NET 3.5 Extensions.  This list has links to all the relevant landing pages & forums for the various technologies covered today.  Newer versions of MVC, Dynamic Data, and the Silverlight Controls have been released since the December 2007 release of the ASP.NET 3.5 Extension Preview.  Make sure you read the release notes of each newer package to understand how to get the newer bits working on top of the December 2007 preview.  The ADO.NET Entity Framework and ADO.NET Data Services in the December 2007 release of the ASP.NET 3.5 Extension Preview are the latest releases as of today (04/30/2008).  Stay tuned for a newer release that will reflect the updates you saw today.

WEBCAST: Overview of the Microsoft ASP.NET 3.5 Extensions Preview

The ASP.NET 3.5 Extensions Preview is a new release that provides new functionality being added to ASP.NET 3.5 and ADO.NET in 2008. This release delivers a set of new features that target:

  • Enabling High Productivity Data Scenarios – including MVC, Entity Framework, ADO.NET Data Services and Dynamic Data
  • Supporting Test Driven Development – including a powerful and extensible MVC framework
  • Creating the best server for Rich Clients – including Ajax history support and Silverlight controls for ASP.NET

We will take a lap around all the great capabilities packed into this upcoming release including ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET AJAX, ADO.NET Entity Framework, ADO.NET Data Services, and Silverlight Controls for ASP.NET.

When

Wednesday, April 30, 2008

2:00P-3:30P EST (11:00A-12:30P PST)

Register at this link:

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032373610&Culture=en-US