<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">A Recipe for New Media</title><subtitle type="html" /><id>http://weblogs.asp.net/adamgreene/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/adamgreene/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2007-09-06T16:48:00Z</updated><entry><title>My Social Media Adventure #2 -- Using StructureMap as a Controller Factory in ASP.NET MVC</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-2-using-structuremap-as-a-controller-factory-in-asp-net-mvc.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-2-using-structuremap-as-a-controller-factory-in-asp-net-mvc.aspx</id><published>2009-09-07T22:02:00Z</published><updated>2009-09-07T22:02:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;The beautiful thing about ASP.NET MVC is that is contains several extension points (in part #1 we saw how the Model Binder extensions work).&amp;nbsp; Another extension point that is of great value is the ControllerFactory.&amp;nbsp; By default, ASP.NET MVC simply looks for a class called {ControllerName}Controller.&amp;nbsp; So a URL like this:&amp;nbsp; http://localhost/Home/Index would look for a controller called HomeController because Home is the controller name.&amp;nbsp; Under the default model factory, you must have a default constructor on your Controller class (you don't actually have to write one as C# will create a default one for you, but if you create a non-default constructor for use in TDD tests, you must explicity write a default constructor, for an example of this concept, take a look at the AccountController that is part of the ASP.NET MVC template project in Visual Studio 2008/2010).&amp;nbsp; This is fine for simple projects, but once you start getting into more complex projects that utilize services / data access patterns / repositories / etc, you could find yourself writing a lot of redundant code.&lt;/p&gt;

&lt;p&gt;That is why Dependency Injection / Inversion of Control came about.&amp;nbsp; By using a DI container like StructureMap, you can decouple the services from the controllers and let the DI container worry about them.&amp;nbsp; So let's start by creating a class that implements the Controller Factory:&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre style="background: rgb(246, 248, 255) none repeat scroll 0% 0%; color: rgb(0, 0, 32); -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;&lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;class&lt;/span&gt; StructureMapControllerFactory &lt;span style="color: rgb(48, 128, 128);"&gt;:&lt;/span&gt; DefaultControllerFactory&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; StructureMapControllerFactory&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;IContainer container&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;container &lt;span style="color: rgb(48, 128, 128);"&gt;=&lt;/span&gt; container&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;override&lt;/span&gt; IController GetControllerInstance&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;Type controllerType&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;try&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;            &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;return&lt;/span&gt; container&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;GetInstance&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;controllerType&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;as&lt;/span&gt; Controller&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;catch&lt;/span&gt; &lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;StructureMapException&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;            System&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Diagnostics&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Debug&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;WriteLine&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;container&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;WhatDoIHave&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;                &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;throw&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;override&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;void&lt;/span&gt; ReleaseController&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;IController controller&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;base&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;ReleaseController&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;controller&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; IContainer container&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;That's it.&amp;nbsp; StructureMap has the ability that the first time it sees a new class, it will auto-generate an injection scheme based on the currently registered services.&amp;nbsp; Let's look at our Global.asax.cs file and see how we use this class:&lt;/p&gt;

&lt;pre style="background: rgb(246, 248, 255) none repeat scroll 0% 0%; color: rgb(0, 0, 32); -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;&lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;void&lt;/span&gt; Application_Start&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;    Container container &lt;span style="color: rgb(48, 128, 128);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;new&lt;/span&gt; StructureMap&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Container&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;&lt;br&gt;    container&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Configure&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;x &lt;span style="color: rgb(48, 128, 128);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        x&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;ForRequestedType&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;lt;&lt;/span&gt;IRepository&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;CacheBy&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;InstanceScope&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;HttpContext&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(48, 128, 128);"&gt;&lt;/span&gt;.TheDefault.Is.OfConcreteType&amp;lt;NHibernateRepository&amp;gt;()&lt;span style="color: rgb(48, 128, 128);"&gt;&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;&lt;br&gt;    ControllerBuilder&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Current&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;SetControllerFactory&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;new&lt;/span&gt; StructureMapControllerFactory&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;container&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Basically what we have done here is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Setup StructureMap.&amp;nbsp; Through we could have used the static class ObjectFactory and made all of our services globally available, I prefer to isolate the services within a private container.&lt;/li&gt;
&lt;li&gt;Register the NHibernateRepository class as the implementer of the IRepository pattern.&lt;/li&gt;
&lt;li&gt;Set the StructureMap Controller Factory as the default factory for finding controllers.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We would then rewrite our HomeController to support the IRepository pattern for data lookup as follows:&lt;/p&gt;
&lt;pre style="background: rgb(246, 248, 255) none repeat scroll 0% 0%; color: rgb(0, 0, 32); -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;&lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;class&lt;/span&gt; HomeController &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;private&lt;/span&gt; IRepository repository&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; HomeController&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;IRepository repo&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;repository &lt;span style="color: rgb(48, 128, 128);"&gt;=&lt;/span&gt; repo&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; ActionResult Index&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        var items &lt;span style="color: rgb(48, 128, 128);"&gt;=&lt;/span&gt; repository&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;GetItems&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Every time a call was made that used the HomeController, StructureMap would new up a HomeController class, passing in the NHibernateRepository as the parameter to the constructor.&amp;nbsp; You no longer have to worry about the implementation details of the repository, in fact you could months from now decide to change from using NHibernate to Entity Data Model and all you would have to do is change the one line in your Global.asax.cs that sets the concrete implementation of IRepository to your new repository class, like so:&lt;/p&gt;&lt;pre style="background: rgb(246, 248, 255) none repeat scroll 0% 0%; color: rgb(0, 0, 32); -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;x&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;ForRequestedType&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;lt;&lt;/span&gt;IRepository&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;CacheBy&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;InstanceScope&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;HttpContext&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;TheDefault&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Is&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;OfConcreteType&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;lt;&lt;/span&gt;EdmRepository&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;And every single controller in your project that depended on IRepository will start using the Entity Data Model version of your repository without any further changes.&lt;/p&gt;&lt;p&gt;I will talk about the implementation details of the NHibernateRepository next, it will be a multipart treatment as there is a lot of details in the actual implementation as I use Fluent NHibernate, StructureMap as BytecodeProvider (to provide DI to the data model), and LINQ to NHibernate behind the scenes.&amp;nbsp; I will also discuss some performance enhancements I made to the repository. &lt;br&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7195971" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author></entry><entry><title>My Social Media Adventure #1 -- DataAnnotations Model Binder</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-1-dataannotations-model-binder.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="56082" href="http://weblogs.asp.net/adamgreene/attachment/7195931.ashx" /><id>http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-1-dataannotations-model-binder.aspx</id><published>2009-09-07T19:44:00Z</published><updated>2009-09-07T19:44:00Z</updated><content type="html">&lt;p&gt;An important part of ASP.NET MVC is the ability to specify a complex object type as the parameter to your controller action method and have MVC "hydrate" your object from the Form data sent to the server by the browser.&amp;nbsp; For Scott Guthrie's treatment on this feature, go &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/10/16/asp-net-mvc-beta-released.aspx#three" title="ASP.NET MVC Model Binders" mce_href="http://weblogs.asp.net/scottgu/archive/2008/10/16/asp-net-mvc-beta-released.aspx#three"&gt;here&lt;/a&gt;.&amp;nbsp; I'm not going to review this functionality.&amp;nbsp; What I want to talk about is the fact that model validation can be built into the Model Binder so that not only is your object hydrated, it is automatically validated without you ever having to worry about it.&amp;nbsp; There are several different possible technologies that could be used to do this validation.&amp;nbsp; I personally looked at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;System.ComponentModel.DataAnnotations (Check out Phil Haack's great MIX09 session "&lt;a href="http://videos.visitmix.com/MIX09/T44F" title="Ninja on Fire Blackbelt Tips" mce_href="http://videos.visitmix.com/MIX09/T44F"&gt;Ninja on Fire Blackbelt tips&lt;/a&gt;" for an awesome overview of this and other MVC stuff)&amp;nbsp;&lt;/li&gt;

&lt;li&gt;NHibernate.Validators&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I ultimately selected DataAnnotations for 3 reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first and biggest reason I chose DataAnnotations, was one of the requirements I had was localization and I was going to be developing custom validators.&amp;nbsp; I searched the web over looking for a simple way to do this with NHibernate.Validator and there wasn't one (you actually had to implement an interface, override a default class and lose a bunch of the baked in functionality, not good in my books).&amp;nbsp; With DataAnnotations, I simply needed to extend the base class ValidationAttribute and all the localization goodness was baked in.&lt;br&gt;&lt;/li&gt;

&lt;li&gt;Complexity, NHibernate.Validator uses an attribute and a validator class, which are connected via an attribute on the attribute... Way too complicated (DataAnnotations, the attribute handles validation as well).&lt;/li&gt;

&lt;li&gt;DataAnnotation Model Binder is going to be baked into ASP.NET MVC 2.0.&lt;br&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, having made that decision, I began testing with the default DataAnnotations Model Binder sample posted &lt;a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471" mce_href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471"&gt;here&lt;/a&gt;.&amp;nbsp; The first thing I realized was that Localization was &lt;span style="font-weight: bold; font-style: italic;"&gt;broken&lt;/span&gt;!!&amp;nbsp; It, thankfully, was an easy fix. I just removed the call to GetDisplayName from the OnModelUpdated as it was unnecessary, and instead of the call to GetDisplayName in OnPropertyValidating, I put this line:&amp;nbsp; &lt;/p&gt;

&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; validationContext.MemberName = propertyDescriptor.Name;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;And everything started working as expected.&amp;nbsp; To save you time, I've attached the changed file.&amp;nbsp; For more information on how to actually implement the DataAnnotations Model Binder, I recommend watching the video referenced above (Ninja on Fire, at position 61:00 of the video, though I highly recommend the whole video).&lt;/p&gt;&lt;p&gt;(&lt;b&gt;NOTE:&lt;/b&gt;&amp;nbsp; The file really is attached... it is at the very bottom of this post, but if you don't see it... &lt;a href="http://weblogs.asp.net/adamgreene/attachment/7195931.ashx" mce_href="http://weblogs.asp.net/adamgreene/attachment/7195931.ashx"&gt;Click Here&lt;/a&gt;) &lt;br&gt;&lt;/p&gt;

&lt;p&gt;Ok, having fixed the bug (there was one other bug I heard about, but had not run into yet, about nested complex properties, that I've included the fix for as well), I started writing my custom Validators.&amp;nbsp; The first of which was CreditCardValidatorAttribute, which (obviously) implements a credit card validation.&amp;nbsp; So let's look at how I did that.&amp;nbsp; I'm going to exclude the actual code that does the validation (again, I've included the whole source code in the attachment) and look more at the code specific to DataAnnotations:&lt;/p&gt;

&lt;pre style="background: rgb(246, 248, 255) none repeat scroll 0% 0%; color: rgb(0, 0, 32); -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;&lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;class&lt;/span&gt; CreditCardAttribute &lt;span style="color: rgb(48, 128, 128);"&gt;:&lt;/span&gt; AbstractLuhnAttribute&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; CreditCardAttribute&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;            &lt;span style="color: rgb(48, 128, 128);"&gt;:&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;base&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(48, 128, 128);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;gt;&lt;/span&gt; Resources&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;AbstractLuhn_ErrorMessage&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt; &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;That's it.&amp;nbsp; As I said, I wasn't going to look at the code to do the actual credit card validation (Which is in AbstractLuhnAttribute).&amp;nbsp; What is happening here is that the ValidationAttribute base class contains a constructor that takes a Func&amp;lt;string&amp;gt; parameter which it will use to lookup the error message. In the constructor of our CreditCardValidator, we pass it a value that comes from the Resources of the DLL containing this validator.&lt;/p&gt;
&lt;p&gt;If you have watched the video as I suggested you would have seen Phil Haack showing you how to define your own Error messages and how to place them into your own Resources within the ASP.NET MVC Web project, all of that example is totally valid with this Credit Card Validator as well!&lt;/p&gt;
&lt;p&gt;The next validator I implemented was a copy of the Future validator from the NHibernate.Validator project, which validated that a date is in the future.&amp;nbsp; I made a slight modification (due to business rules requirements) and I implemented TodayOrFuture.&amp;nbsp; It was slightly different from the Credit Card validator in that it's validation message required a more complex token replacement.&amp;nbsp; So here is the important code (again, the actual validation has been removed, but is included in the attachment to this article. ):&lt;/p&gt;

&lt;pre style="background: rgb(246, 248, 255) none repeat scroll 0% 0%; color: rgb(0, 0, 32); -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;&lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;class&lt;/span&gt; TodayOrFutureAttribute &lt;span style="color: rgb(48, 128, 128);"&gt;:&lt;/span&gt; ValidationAttribute&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; TodayOrFutureAttribute&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(48, 128, 128);"&gt;:&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;base&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(48, 128, 128);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;&amp;gt;&lt;/span&gt; Resources&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;TodayOrFuture_ErrorMessage&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;override&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;string&lt;/span&gt; FormatErrorMessage&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;string&lt;/span&gt; name&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt;&lt;br&gt;        &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;string&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Format&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;CultureInfo&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;CurrentCulture&lt;span style="color: rgb(48, 128, 128);"&gt;,&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;base&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;ErrorMessageString&lt;span style="color: rgb(48, 128, 128);"&gt;,&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;&lt;br&gt;                  new&lt;/span&gt; &lt;span style="color: rgb(32, 0, 128); font-weight: bold;"&gt;object&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;]&lt;/span&gt; &lt;span style="color: rgb(64, 96, 128);"&gt;{&lt;/span&gt; name&lt;span style="color: rgb(48, 128, 128);"&gt;,&lt;/span&gt; DateTime&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;Now&lt;span style="color: rgb(48, 128, 128);"&gt;.&lt;/span&gt;ToShortDateString&lt;span style="color: rgb(48, 128, 128);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;span style="color: rgb(48, 128, 128);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;;&lt;/span&gt;&lt;br&gt;    &lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;span style="color: rgb(64, 96, 128);"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The difference is the FormatErrorMessage method, which allows us to inject a value into the ErrorMessage (which the raw form is &lt;/p&gt;&lt;p&gt;{0} must be greater than or equal to {1}&lt;/p&gt;&lt;p&gt;so when you input an incorrect date, you will get an error message that reads like:&lt;/p&gt;&lt;p&gt;&lt;font color="#ff0000"&gt;Post Date must be greater than or equal to 09/09/2009&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Again, it makes creating a custom validator extremely easy.&amp;nbsp; And for those who noticed that I did not involve the Culture in generating the Date string, good eye!&amp;nbsp; I didn't realize it myself until after I had written this article.&amp;nbsp; I'm going to fix it in the attachment. &lt;/p&gt;&lt;p&gt;&amp;nbsp;Up next will be a look at how I integrated StructureMap with the ASP.NET MVC ControllerFactory to provide Dependency Injection to the Controllers.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7195931" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/adamgreene/archive/tags/ASP.NET+MVC/default.aspx" /><category term="DataAnnotations" scheme="http://weblogs.asp.net/adamgreene/archive/tags/DataAnnotations/default.aspx" /></entry><entry><title>My Social Media Adventure</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure.aspx</id><published>2009-09-07T19:11:00Z</published><updated>2009-09-07T19:11:00Z</updated><content type="html">&lt;p&gt;Here at Trimedia Atlantic, we've started a new project that I am very excited about, though I cannot yet talk about what that project is, I will talk about my experiences in developing it as we are using a great deal of cutting edge technology, such as a great deal of the NHibernate suite of technologies (Base, Search, etc), StructureMap IoC, AutoMapper, and ASP.NET MVC (along with Telerik's ASP.NET MVC framework).&amp;nbsp; I have had quite a few moments of excitement as I have discovered the capabilities of the platform(s), moments where the lights came on and I "got" the concepts of why and how, and moments of frustration as things "broke" (or in some cases where never meant to work that way).&amp;nbsp; I'm going to blog every day about my experiences as I work through the development cycle (but being horrible as I am at blogging, that remains to be seen).&lt;/p&gt;&lt;p&gt;So here is the list of technologies that I am using:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://nhforge.org/Default.aspx" title="NHibernate 2.1" target="_blank" mce_href="http://nhforge.org/Default.aspx"&gt;NHibernate 2.1&lt;/a&gt; (Data Access Layer)&lt;/li&gt;&lt;li&gt;NHibernate Search (which the source code was a pain to find)&lt;/li&gt;&lt;li&gt;&lt;a href="http://sourceforge.net/projects/nhibernate/files/" title="Linq to NHibernate" mce_href="http://sourceforge.net/projects/nhibernate/files/"&gt;Linq to NHibernate&lt;/a&gt; (Though not the exclusive data access technology, it is used quite a bit)&lt;/li&gt;&lt;li&gt;Castle DynamicProxy2 (for writing some proxy code)&lt;br&gt;&lt;/li&gt;&lt;li&gt;ELMAH (Error Reporting)&lt;/li&gt;&lt;li&gt;&lt;a href="http://fluentnhibernate.org/" title="Fluent NHibernate" mce_href="http://fluentnhibernate.org/"&gt;Fluent NHibernate&lt;/a&gt; (Fluent management of NHIbernate Config and Entity Mapping)&lt;/li&gt;&lt;li&gt;&lt;a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471" title="DataAnnotations Model Binder" mce_href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471"&gt;DataAnnotations Model Binder&lt;/a&gt; (took the original and fixed some of the problems, such as incorrect handling of Display Attributes, and ported several of NHibernate Validator validators)&lt;/li&gt;&lt;li&gt;&lt;a href="http://structuremap.sourceforge.net/Default.htm" title="StructureMap" mce_href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; Inversion of Control Container (It's the glue that holds all the other technology together and makes dependency injection so much fun!!&amp;nbsp; Seriously, I'm loving DI)&lt;/li&gt;&lt;li&gt;TweetSharp (Great Twitter integration library)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.telerik.com/products/aspnet-mvc.aspx" title="Telerik ASP.NET MVC Extensions" mce_href="http://www.telerik.com/products/aspnet-mvc.aspx"&gt;Telerik ASP.NET MVC Extensions&lt;/a&gt; (does a great job of managing CSS and JS files, urls, and does file combining and makes using jQuery UI much easier)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I will warn people right now, my biggest complaint is (and will be) the lack of good documentation for these projects, there has been a lot of trial and error and learning on my part as to how these technologies work (sometimes work best, sometimes I just go them working and will worry about optimization later).&amp;nbsp; I hope that people benefit from my experience in the course of this blog.&lt;/p&gt;&lt;p&gt;Post #1 -- &lt;a href="http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-1-dataannotations-model-binder.aspx" mce_href="http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-1-dataannotations-model-binder.aspx"&gt;DataAnnotations Model Binder &lt;/a&gt;&lt;br&gt;Post #2 -- &lt;a href="http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-2-using-structuremap-as-a-controller-factory-in-asp-net-mvc.aspx" mce_href="http://weblogs.asp.net/adamgreene/archive/2009/09/07/my-social-media-adventure-2-using-structuremap-as-a-controller-factory-in-asp-net-mvc.aspx"&gt;Using StructureMap as Controller Factory in ASP.NET MVC&lt;/a&gt;&lt;br&gt;Post #3 -- Implementing the Repository pattern with NHibernate and Fluent NHibernate&lt;br&gt;Post #4 -- Implementing the NHibernate BytecodeProvider with StructureMap&lt;br&gt;Post #5 -- Implementing NHibernate.Search&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7195868" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/adamgreene/archive/tags/ASP.NET+MVC/default.aspx" /><category term="NHibernate" scheme="http://weblogs.asp.net/adamgreene/archive/tags/NHibernate/default.aspx" /><category term="StructureMap" scheme="http://weblogs.asp.net/adamgreene/archive/tags/StructureMap/default.aspx" /><category term="DataAnnotations" scheme="http://weblogs.asp.net/adamgreene/archive/tags/DataAnnotations/default.aspx" /><category term="AutoMapper" scheme="http://weblogs.asp.net/adamgreene/archive/tags/AutoMapper/default.aspx" /></entry><entry><title>ASP.NET Async Controllers Rock!!</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2009/04/03/asp-net-async-controllers-rock.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2009/04/03/asp-net-async-controllers-rock.aspx</id><published>2009-04-03T16:08:00Z</published><updated>2009-04-03T16:08:00Z</updated><content type="html">&lt;p&gt;I've been watching videos from MIX 09 and following along and doing the examples presented (love Phil Haack's &lt;a href="http://videos.visitmix.com/MIX09/T44F" mce_href="http://videos.visitmix.com/MIX09/T44F"&gt;Ninja on Fire Black Belt Tips for ASP.NET MVC&lt;/a&gt;).&amp;nbsp; There are a lot of good things coming out in regards to ASP.NET and Silverlight that I will talk about later, but there is one thing that I'm really excited about in ASP.NET MVC Futures that i found as a result of my digging and that is &lt;b&gt;Aysnc Controllers&lt;/b&gt;.&amp;nbsp; For everyone who has used ASP.NET WebForms async support, you basically know what I'm talking about.&amp;nbsp; For those who don't here is the run down:&lt;/p&gt;
&lt;p&gt;Every action done in code carries with it an inherent time to complete, some are so quick they are imperceptible, others like web services access and database access (or anything requiring disk or network access for that matter) have a noticeable delay at times (especially in data mining and OLAP scenarios).&amp;nbsp; In many web application systems you are forced to simply run each action synchronously and wait for each event to complete before going onto the next.&amp;nbsp; So if you are accessing a web service and doing analytical processing, it could take quite a bit of time.&amp;nbsp; But what if you could run the activities in parallel?&amp;nbsp; It would greatly decrease the wait time for the end user.&amp;nbsp; That is where Async mode comes in.&amp;nbsp; Here is an example of an async action on a MVC Controller:&lt;br&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;
&lt;link href="file:///C:%5CDOCUME%7E1%5Cadam%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List" mce_href="file:///C:%5CDOCUME%7E1%5Cadam%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:OfficeDocumentSettings&gt;
  &lt;o:RelyOnVML/&gt;
  &lt;o:AllowPNG/&gt;
 &lt;/o:OfficeDocumentSettings&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;link href="file:///C:%5CDOCUME%7E1%5Cadam%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData" mce_href="file:///C:%5CDOCUME%7E1%5Cadam%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;
&lt;link href="file:///C:%5CDOCUME%7E1%5Cadam%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping" mce_href="file:///C:%5CDOCUME%7E1%5Cadam%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:TrackMoves/&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:DontVertAlignCellWithSp/&gt;
   &lt;w:DontBreakConstrainedForcedTables/&gt;
   &lt;w:DontVertAlignInTxbx/&gt;
   &lt;w:Word11KerningPairs/&gt;
   &lt;w:CachedColBalance/&gt;
  &lt;/w:Compatibility&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val="Cambria Math"/&gt;
   &lt;m:brkBin m:val="before"/&gt;
   &lt;m:brkBinSub m:val="&amp;#45;-"/&gt;
   &lt;m:smallFrac m:val="off"/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val="0"/&gt;
   &lt;m:rMargin m:val="0"/&gt;
   &lt;m:defJc m:val="centerGroup"/&gt;
   &lt;m:wrapIndent m:val="1440"/&gt;
   &lt;m:intLim m:val="subSup"/&gt;
   &lt;m:naryLim m:val="undOvr"/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267"&gt;
  &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;
  &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;
  &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;
  &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;
  &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;
  &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;
  &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;public&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;ActionResult&lt;/span&gt;&amp;gt; Foo(&lt;span style="color: blue;"&gt;int&lt;/span&gt;
id) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&amp;nbsp;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;AsyncManager.RegisterTask(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;callback =&amp;gt; BeginGetPersonById(id,
callback, &lt;span style="color: blue;"&gt;null&lt;/span&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ar =&amp;gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ViewData[&lt;span style="color: rgb(163, 21, 21);"&gt;"p"&lt;/span&gt;]
= EndGetPersonById(ar);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;AsyncManager.RegisterTask(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;callback =&amp;gt;
BeginGetTotalUsersOnline(callback, &lt;span style="color: blue;"&gt;null&lt;/span&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ar =&amp;gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ViewData[&lt;span style="color: rgb(163, 21, 21);"&gt;"numOnline"&lt;/span&gt;]
= EndGetTotalUsersOnline(ar);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; View;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: 'Courier New';"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;What is happening here is that the MVC system executes both BeginGetPersonById and BeginGetTotalUsersOnline in parallel and when both complete, it will then process the View (display the web page).&amp;nbsp; Simple, clean, efficient.&amp;nbsp; &lt;/p&gt;&lt;p&gt;I used to play around with Ruby on Rails, and basically bought their: "&lt;i&gt;The real problem is development time not runtime.&amp;nbsp; Just throw more hardware at it if it gets slow.&lt;/i&gt;"&amp;nbsp; But there are some things you simply cannot speed up no matter how much hardware you throw at it (especially when you are making calls out into the cloud to services you don't control).&amp;nbsp; To be able to cut the execution time via async callbacks will make a huge difference in client perception of speed.&amp;nbsp; Couple that with the fact that ASP.NET MVC beats the pants off of RoR speedwise and basically provides for all the same scenarios (I will admit that ActiveRecord is a hard act to follow, but LinqToEntities is close and gives you data model visualization as an added bonus.&amp;nbsp; Personally I'm using FluentNHibernate with LinqToNHibernate as I am a control freak and don't like the baggage that gets added to each class).&lt;/p&gt;&lt;p&gt;&lt;b&gt;EDIT (Aug 17, 2009)&lt;/b&gt;:&amp;nbsp; LinqToEntities V4 is doing something about the "baggage" and allowing POCO (Plain Old C# Objects) to be used, with supporting classes to handle the mapping.&amp;nbsp; I'm still using NHibernate, especially with all the coolness that is baked into NHibernate 2.1. &lt;br&gt;&lt;/p&gt;&lt;p&gt;So for me, and especially because we build Facebook applications where how fast we can service the clients translates into customer satisfaction, the speed, the control, and the support we get from Microsoft for ASP.NET MVC makes it a no brainer for me to go with ASP.NET MVC.&lt;/p&gt;&lt;p&gt;So if you want to join the ASP.NET MVC camp, just go to &lt;a href="http://www.asp.net/mvc" mce_href="http://www.asp.net/mvc"&gt;http://www.asp.net/mvc&lt;/a&gt; and you will find everything you need to get started, including great tutorials and example applications.&amp;nbsp; If you are already using ASP.NET MVC and want to see what I'm talking about with Async Controllers, then go to &lt;a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471" mce_href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471"&gt;http://www.codeplex.com/aspnet&lt;/a&gt; and download&lt;b&gt; &lt;/b&gt;&lt;span class="FileNameLink"&gt;&lt;b&gt;ASP.NET MVC v1.0 Futures&lt;/b&gt; and &lt;b&gt;Using the AsyncController.docx&lt;/b&gt; to get started (It does assume some understanding of asynchronous methods and how they work).&lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7024510" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/adamgreene/archive/tags/ASP.NET/default.aspx" /><category term="Async Controllers" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Async+Controllers/default.aspx" /><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/adamgreene/archive/tags/ASP.NET+MVC/default.aspx" /></entry><entry><title>WIPP (Windows IIS PostgreSQL PHP)</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2007/11/06/wipp-windows-iis-postgresql-php.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2007/11/06/wipp-windows-iis-postgresql-php.aspx</id><published>2007-11-06T18:12:00Z</published><updated>2007-11-06T18:12:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Here's a fun one for all you LAMP fans out there.&amp;nbsp; I have inherited a PHP/PostgreSQL based website from another company.&amp;nbsp; Scenario:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;UBuntu Linux 7.02&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PHP 5&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PostgreSQL 8.2&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Apache 2.2&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;Beautiful setup, works great.&amp;nbsp; Problem.&amp;nbsp; I need PHP 4.4 for this &lt;A class="" href="http://www.menutools.com/" target=_blank mce_href="http://www.menutools.com"&gt;project&lt;/A&gt;.&amp;nbsp; I figured, no problem, just revert to PHP 4.4. No go. UBuntu doesn't do PHP 4.X anymore and PHP 5 breaks the code.&amp;nbsp; I figured I would download and compile PHP 4.4.&amp;nbsp; Stonewalled again.&amp;nbsp; Apache 2.2 is not supported by PHP 4.X (or posssibly more accurately, Apache doesn't support PHP 4.X?)&amp;nbsp; So now I have to revert the webserver.&amp;nbsp; I realized that this was getting a little crazy.&amp;nbsp; Since I dual boot my computer with Windows XP, I jumped over the XP, installed PHP 4.4 and&amp;nbsp;PostgreSQL 8.2 had the site up in less than an hour.&amp;nbsp; It was far simpler than trying to deal with Linux and the fact I would have to recompile PHP 4.X (and hope that I didn't miss a required module and have to re-configure / compile / install or get a configuration switch wrong, and other such problems).&amp;nbsp; So I guess you could say I WIPP'd the LAMP.&amp;nbsp;Yes, that's a bad joke, I'm a programmer not a comedian.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;On a positive note though, I am quite impressed with &lt;A class="" href="http://www.aptana.org/" target=_blank mce_href="http://www.aptana.org"&gt;Aptana&lt;/A&gt; for PHP editing.&amp;nbsp; It is well done and made my work a lot easier.&amp;nbsp; Now if only they could fix Ruby code completion (see previous articles about my adventures with Ruby on Rails).&amp;nbsp; I am also trying to convince the stakeholders in the project that ASP.NET would be a better platform, but that will take time...&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4920362" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="PHP" scheme="http://weblogs.asp.net/adamgreene/archive/tags/PHP/default.aspx" /><category term="Aptana" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Aptana/default.aspx" /><category term="WIPP" scheme="http://weblogs.asp.net/adamgreene/archive/tags/WIPP/default.aspx" /><category term="LAMP" scheme="http://weblogs.asp.net/adamgreene/archive/tags/LAMP/default.aspx" /><category term="IIS" scheme="http://weblogs.asp.net/adamgreene/archive/tags/IIS/default.aspx" /><category term="PostgreSQL" scheme="http://weblogs.asp.net/adamgreene/archive/tags/PostgreSQL/default.aspx" /></entry><entry><title>Visual Studio 2008 vs Ruby on Rails</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2007/10/23/visual-studio-2008-vs-ruby-on-rails.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2007/10/23/visual-studio-2008-vs-ruby-on-rails.aspx</id><published>2007-10-23T16:01:00Z</published><updated>2007-10-23T16:01:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;I had the pleasure of attending an information session with Bruce Tate, CTO of &lt;A class="" href="http://wellgoodllc.com/" target=_blank mce_href="http://wellgoodllc.com"&gt;WellGood LLC&lt;/A&gt;, a die hard Ruby on Rails fan, and before that a die hard fan of Spring and Hibernate in the Java World, and before that a die hard Java fan :-)&amp;nbsp; To be fair, Bruce is about doing things quickly and efficiently and I agree Ruby allows you to develop simple websites quickly that are mainly CRUD applications.&amp;nbsp; So I understand why Bruce abandoned the Java world for the Ruby on Rails world, I left the Java world in favor of ASP.NET because of many of the same reasons that Bruce jumped on the Ruby on Rails bandwagon.&amp;nbsp; But there are some things about Ruby to Rails that still bother me.&lt;/P&gt;
&lt;P mce_keep="true"&gt;About 2 years ago, I looked into Ruby on Rails, even learned how to use it (loved the Pragmatic Programmer's books on Ruby and Rails), but it was a pig to host and get up and running on anything other than the infamous &lt;A href="http://localhost:3000/"&gt;http://localhost:3000/&lt;/A&gt; and don't even think about hosting a high volume website at that time.&amp;nbsp; Now, Bruce told us that&amp;nbsp;most websites&amp;nbsp;do not&amp;nbsp;deal with the scale that would require a more powerful platform like ASP.NET, and I agree.&amp;nbsp; But fast foward 2 years to today and I asked Bruce the question "what about hosting?".&amp;nbsp; His response?&amp;nbsp; "That continues to be a thorn in my side.... but I've written a book."&amp;nbsp; Thanks Bruce, I don't want a book, I want an answer.&amp;nbsp; I'm sure it's a good book, but it is still a very telling thing that it is hard to get a good hosting environment.&amp;nbsp; ASP.NET may be "big, bloated, and have a lot of configuration files", but have you seen what Apache magic you have to do to get this RoR thing hosted?&amp;nbsp; Sure Ruby on Rails itself doesn't have a lot of configuration files, but Apache does and so does MySQL (the choice among open source developers).&amp;nbsp; With Windows 2008 server coming down the pipe with IIS 7, configuration is much simpler than it used to be and the fully integrated ASP.NET pipeline makes for a very fast system.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;The second question I asked him was about design, there are currently no Ruby specific WYSIWYG systems out there, but you can design your look in Dreamweaver and then edit in the dynamic content.&amp;nbsp; That is how I used to do it with Java / Tapestry, so it's not new to me.&amp;nbsp; But I've gone to ASP.NET and I don't want to give up my WYSIWYG with all the wizards that make my design life easier.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Finally, I asked him to show us an actual Ruby on Rails scaffold.&amp;nbsp; He spent most of the time, granted he had a very short time, praising the Ruby language and ActiveRecord.&amp;nbsp; Both of which I think are great, I wish I had ActiveRecord in ASP.NET.&amp;nbsp; He quickly showed us a scaffold and how it works and I was impressed (especially with the new migration capabilities of ActiveRecord).&lt;/P&gt;
&lt;P mce_keep="true"&gt;So the question is:&amp;nbsp; Are all the great things they are saying about Ruby on Rails really worth switching?&amp;nbsp; I'm sorry Microsoft, but ASP.NET is awesome for complex websites dealing with heterogeneous data sources within a clustered environment where the ability to monitor and manage the application and it's performance is important and where the pages are more complex than a simple data presentation... actually... well done Microsoft!!&amp;nbsp; Being that our company develops for the DotNetNuke platform, and Ruby doesn't have anything approaching a Portal platform with modular components and full membership management and granular security model (asked Bruce he couldn't think of any), we feel that Ruby on Rails answers a particular set of questions / problems that were the blight of the Java world and in same cases of the ASP.NET world as well, and when we do a project from scratch that fits the bill, we will definitely look at Ruby on Rails as a possible solution.&lt;/P&gt;
&lt;P mce_keep="true"&gt;So some people who know me and know Bruce, may be asking "What is Bruce Tate, a big name Ruby on Rails person from Texas, doing in New Brunswick, Canada?"&amp;nbsp; Well, it's simple.&amp;nbsp; A local company switched their whole operation to Ruby on Rails and moved one of the big internet success stories from an ASP platform to Ruby On Rails.&amp;nbsp; PropertyGuys.com, a For-Sale-By-Owner website franchise started here in New Brunswick, moved from ASP to Ruby on Rails.&amp;nbsp; They looked at ASP.NET / C# for their system but found that Ruby on Rails allowed them the speed, flexibility and readability they wanted to quickly and easily prototype their new applications (more or less their words, I paraphrased it).&lt;/P&gt;
&lt;P mce_keep="true"&gt;So do I think PropertyGuys.com was right to make the move?&amp;nbsp; Faced with current technologies, Yes.&amp;nbsp; Wait. Wait.&amp;nbsp; Don't start throwing the rotten vegetables yet.&amp;nbsp; Notice I said, faced with &lt;U&gt;current&lt;/U&gt; technologies.&amp;nbsp; Microsoft, despite many people's opinions, hasn't been sticking it's head in sand.&amp;nbsp; They have been working towards Visual Studio 2008, which I think shows a lot of promise in answering the issues that Ruby on Rails raised.&amp;nbsp; So let's look at them:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;ActiveRecord&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;For those of use who have been subjected to DataSets, anything had to be better.&amp;nbsp; I have quite enjoyed developing with NHibernate Object Relational Mapper (ORM) and a visual design environment from Puzzle called ObjectMapper.&amp;nbsp; Since it is open source, I have "hacked" it up to better match my "brand" of development (mainly that it didn't support NHibernate 1.2).&amp;nbsp; It allowed me to define the data model and produce the NHibernate code from the same visual model.&amp;nbsp; It works great, but ActiveRecord and Bruce Tate are right.&amp;nbsp; It's too much.&amp;nbsp; ObjectMapper doesn't do everything I want (and sometimes gets it wrong), so I have to dig into the XML description file and make some changes by hand, recompile the Class Library and restart the application.&amp;nbsp; That is too much work.&lt;/P&gt;
&lt;P mce_keep="true"&gt;ActiveRecord on the other hand, simply looks like this:&lt;/P&gt;
&lt;P style="FONT-FAMILY: Courier New" mce_keep="true"&gt;class Item &amp;lt; ActiveRecord::Base&lt;BR&gt;end 
&lt;P mce_keep="true"&gt;And you're done.&amp;nbsp; That's all you need for a full fledged ORM.&amp;nbsp; You can do things like Item.find_all_by_name, Item.find_by_id and ActiveRecord interprets (because it's a scripting language) what you mean and runs the SQL to retrieve what you want.&amp;nbsp; You can even say Item.find_all_by_name_and_price, it's that good at understanding what you want.&amp;nbsp; I have to admit that ActiveRecord is a hard act to follow.&amp;nbsp; So how does Microsoft answer the challenge? LINQ.&lt;/P&gt;
&lt;P mce_keep="true"&gt;What I like about LINQ is that fact that I can open a database connection, drag a table onto a form, see it visually along with all it's relationships, and have that generate the code for me.&amp;nbsp; Yes, it's more work than ActiveRecord, no it doesn't have migrations (migrations are a feature of ActiveRecord that allows you to define the versioning of your database and roll forward and backwards based on what you need, adding or deleting columns, indices, whole tables).&amp;nbsp; Yes, migrations are specified in Ruby code and require seperate files and properly named classes (How was I supposed to know that a file named 001_Create_Item_Table.rb should contain a class called CreateItemTable...), but they are a neat idea and make it very easy to upgrade a production database to the current version of the site.&amp;nbsp; Oh, sorry.&amp;nbsp; Back to LINQ.&amp;nbsp; So though LINQ is no ActiveRecord, it is definitely far better than DataSets and probably better than NHibernate in many respects.&amp;nbsp; The fact that you will be able to use LINQ with NHibernate is cool.&amp;nbsp; (LINQ doesn't have any built in caching ability like NHIbernate, at least as far as I know).&amp;nbsp; There is enough stuff out on the web about LINQ, I won't bore you with the details.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Dynamic Language&lt;BR&gt;&lt;/STRONG&gt;Ruby as a language is quite cool.&amp;nbsp; It supports continuations, method objects, enclosures, dynamic type system, the ability to extend classes on the fly by adding mixins and new methods.&amp;nbsp; I can't argue with the language.&amp;nbsp; But a lot of the things that are part of Ruby are now in Visual Studio 2008 (except I haven't heard anything about continuations).&amp;nbsp; It has lambda statements, delegates, variable type.&amp;nbsp; The only big thing it lacks is the ability to redefine a class on the fly.&amp;nbsp; And there are many things in the standard Ruby library that I wish were in .NET APIs.&amp;nbsp; But for the most part, Ruby's benefits are being answered in one way or another in C#.&amp;nbsp; Some may say "too little, too late".&amp;nbsp; To those I say "Well, Ruby runs on .NET thanks to IronRuby".&amp;nbsp; Yes, you can run Ruby on .NET.&amp;nbsp; It's not a full implementation yet and it's not as fast as it could be, but it's not done yet.&amp;nbsp; And being that it is fully backed by Microsoft, it will be the best it can be when it's completed.&amp;nbsp; (I know, it is the same company that gave us Windows, but their development department is really quite good.)&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Scaffolds&lt;BR&gt;&lt;/STRONG&gt;I admit, I like the idea of being able to say "Generate Scaffold Item" and get a complete CRUD system that just works, that is until you change the database and have to regenerate the scaffold.... At least with the GridView in ASP.NET it could dynamically regenerate the Grid (including edit forms) and Details View (so you could insert) based on the underlying database changes.&amp;nbsp; And with the addition of Dynamic Forms to Visual Studio 2008, you get the power of scaffolds and Grid View combined.&amp;nbsp; So Scaffolds are less of an issue compared to Visual Studio 2008.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;DRY&lt;BR&gt;&lt;/STRONG&gt;Every where I turn with Rails, people are talking about &lt;STRONG&gt;D&lt;/STRONG&gt;o not &lt;STRONG&gt;R&lt;/STRONG&gt;epeat &lt;STRONG&gt;Y&lt;/STRONG&gt;ourself.&amp;nbsp; That means "If you do something once, you shouldn't have to redo it again."&amp;nbsp; I actually find that kind of funny coming from a system that doesn't really support componentized development.&amp;nbsp; You generate a scaffold, then have to edit it to make look the way you want, rinse and repeat with every form you need.&amp;nbsp; Yes, you can make reusable components in Rails, but in every place they tell you you can do it, they say "Don't do it!! It's too slow.&amp;nbsp; They are hard to manage."&amp;nbsp; Hmm... I like the fact that I can develop full components and place them into a DLL and simply by referencing the DLL, the components become available for WYSIWYG insertion and configuration.&amp;nbsp; Again, Ruby on Rails answers a particular challenge and answers it very well.&amp;nbsp; But when you don't want to completely rebuild a site every time you get a new project, you might want to look DotNetNuke.&amp;nbsp; With DotNetNuke, we can build a site very quickly, easily, and visually.&amp;nbsp; Yes it probably takes me longer to build a new component, but then the component is fully reusable.&amp;nbsp; Yes, DotNetNuke is a framework on top of ASP.NET, but Rails is&amp;nbsp;a framework as well.&amp;nbsp; So let's just say that DRY is an over used word.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Code completion and compile time error checking&lt;BR&gt;&lt;/STRONG&gt;There is one big advantage with Ruby, no compiling.&amp;nbsp; There is one big problem with Ruby, no compiling.&amp;nbsp; When you don't precompile an application, you don't find the logic errors until the line of code is run.&amp;nbsp; When you don't compile, you don't have the benefit of true Code Completion (or at least all the IDEs I've tried don't have code completion that works / works right / actually tries to narrow the options to the selected class!!)&amp;nbsp; Yes, I know that Ruby on Rails comes with a great code coverage tool... but it needs it!!&amp;nbsp; If you don't test every line of code you don't know if you've made stupid mistakes.&amp;nbsp; Yes, I know code coverage is a good idea and that everyone should do it, but if you need code coverage to find semantic errors.... well, let's just say I don't want to look like an idiot when my co-workers run the code coverage tests to find I can't spell :-)&lt;/P&gt;
&lt;P mce_keep="true"&gt;So all in all.&amp;nbsp; If I had to make a choice today, I might choose Ruby on Rails for new development.&amp;nbsp; But for existing development and for projects that fit the portal model, I will definitely stick to DotNetNuke/ASP.NET.&amp;nbsp; When Visual Studio 2008 comes out, I might be less inclined to go for Ruby on Rails.....&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4710933" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="Visual Studio 2008" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Visual+Studio+2008/default.aspx" /><category term="Dynamic Forms" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Dynamic+Forms/default.aspx" /><category term="LINQ" scheme="http://weblogs.asp.net/adamgreene/archive/tags/LINQ/default.aspx" /><category term="ASP.NET" scheme="http://weblogs.asp.net/adamgreene/archive/tags/ASP.NET/default.aspx" /><category term="Ruby on Rails" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Ruby+on+Rails/default.aspx" /><category term="Ruby" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Ruby/default.aspx" /></entry><entry><title>AJAX and Authentication and Profile Services</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2007/09/25/ajax-and-authentication-and-profile-services.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2007/09/25/ajax-and-authentication-and-profile-services.aspx</id><published>2007-09-25T12:10:00Z</published><updated>2007-09-25T12:10:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Still working on our company website, today I decided to try out the Authentication and Profile Services that are part of the &lt;A class="" href="http://ajax.asp.net/" target=_blank mce_href="http://ajax.asp.net"&gt;ASP.NET AJAX Extensions&lt;/A&gt;.&amp;nbsp; Basically (for those who don't know) the Authentication and Profile Services are a set of Javascript classes (Sys.Services.AuthenticationService and Sys.Services.ProfileService respectively) and some built in web services that are part of the extensions, that allow you to log in with actually have to refresh the page or redirect to a new page (and logout as well, but it redirects and/or refreshes the page after it asynchronously logs out) and access ASP.NET Profile properties (both read and write, more on that in a minute).&amp;nbsp; So basically these services allow you to not have to reload pages to access information and manage your logged in state, which means faster response times and smoother user experiences.&lt;/P&gt;
&lt;P mce_keep="true"&gt;So let's look at how we go about doing this.&amp;nbsp; I will assume that you have started from an already existing ASP.NET AJAX-enabled website.&amp;nbsp; (If not, just start Visual Studio 2005 and select ASP.NET AJAX-Enabled Web Site, if you don't see that option, you probably don't have the ASP.NET AJAX Extensions installed, go &lt;A class="" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&amp;amp;displaylang=en"&gt;here&lt;/A&gt; to get them).&amp;nbsp; You will also have to configure your website to use ASP.NET Authentication (I'm not going to cover that here, but you can go &lt;A class="" href="http://aspnet.4guysfromrolla.com/articles/120705-1.aspx" target=_blank mce_href="http://aspnet.4guysfromrolla.com/articles/120705-1.aspx"&gt;here&lt;/A&gt; for a good tutorial on Membership, Roles and Profiles (including authentication)).&lt;/P&gt;
&lt;P mce_keep="true"&gt;Ok, let's begin.&amp;nbsp; The first thing you need to do is turn on the services.&amp;nbsp; In your web.config you will find a configuration section called &amp;lt;system.web.extensions&amp;gt; (you can actually search for that, including the brackets.) and within that section you will find two lines &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;authenticationService&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;enabled&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;requireSSL&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true|false&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; and &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;profileService&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;enabled&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;readAccessProperties&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"" &lt;SPAN style="COLOR: red"&gt;writeAccessProperties&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;""&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&amp;nbsp; They are currently commented out.&amp;nbsp; Uncomment them.&amp;nbsp; The next thing you need to do is decide if you want to force your site to have to use SSL for the authentication process (to protect the username and password), if you can use SSL then go ahead and put &lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New"&gt;true &lt;/FONT&gt;&lt;/SPAN&gt;in &lt;SPAN style="COLOR: red"&gt;&lt;FONT face="Courier New"&gt;requireSSL&lt;/FONT&gt;&lt;/SPAN&gt;, otherwise put &lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New"&gt;false&lt;/FONT&gt;&lt;/SPAN&gt;.&amp;nbsp; The next step is decide what properties you want to expose via the profileService.&amp;nbsp; Let me explain this part in a bit more detail.&lt;/P&gt;
&lt;P mce_keep="true"&gt;This is how my profile is defined:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;profile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;enabled&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;properties&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;group&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Address&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Street1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Street2&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;City&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Province&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Postal&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Country&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;group&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;group&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Contact&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Name&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Title&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Phone&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Cell&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Fax&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Website&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;group&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;add&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;CompanyName&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;properties&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;profile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;P mce_keep="true"&gt;So I decided that I wanted to be able to expose the Contact Name and the Company Name, so I wrote my readAccessProperties attribute like so &lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;readAccessProperties&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-bidi-language: AR-SA; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Contact.Name,CompanyName&lt;/SPAN&gt;"&lt;/SPAN&gt;. Notice how I accessed a property group by using dot notation (Contact as you can see above is a property group and Name is a property in the property group).&amp;nbsp; In code, I would access the property via [Page].Profile.Contact.Name.&amp;nbsp; If you want to give write access to Profile properties then place their names in the writeAccessProperties attribute.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The next step is setting up authentication in the page.&amp;nbsp; The first thing I did was put two input boxes on the page and called one username and the other password.&amp;nbsp; Then I placed a button on the form that when clicked would fire a javascript event called Login.&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;table id="LoginBox"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;tr&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Username: &lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;input&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="text"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="username"&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Password: &lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;input&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="text"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="password"&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;input&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="button"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Log in"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;onclick&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Login()"&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;tr&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;table&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;P mce_keep="true"&gt;The next step is writing the login function:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; uid = $get(&lt;SPAN style="COLOR: #a31515"&gt;"username"&lt;/SPAN&gt;).value;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; pwd = $get(&lt;SPAN style="COLOR: #a31515"&gt;"password"&lt;/SPAN&gt;).value;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;Sys.Services.AuthenticationService.login(uid,pwd,&lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;,&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;,&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;,OnLoginCompleted,OnCommunicationFailed, &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;/SPAN&gt; 
&lt;P&gt;Now we need to write the functions that handle if the login call was successful (not if logging in was successful, that's handled later) or not.&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;function&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; OnLoginCompleted(isValid,userContext, methodName) {&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (isValid) {&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;LoadProfile(userContext);&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;else&lt;/SPAN&gt; {&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;alert(&lt;SPAN style="COLOR: #a31515"&gt;"Login failed."&lt;/SPAN&gt;);&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;}&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;function&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; OnCommunicationFailed(error, userContext, methodName)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;alert(&lt;SPAN style="COLOR: #a31515"&gt;"Attempt failed: "&lt;/SPAN&gt; + error.get_message());&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;}&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; 
&lt;P mce_keep="true"&gt;Obviously, you can make these functions much more "elegant", but these will do for now.&amp;nbsp; At this point (apart from the LoadProfile method call), you can log someone in and handle a successful login or a bad username/password.&amp;nbsp; And if there is a communication failure with the server, it will call OnCommunicationFailed.&amp;nbsp; Logging someone out is as simple as calling Sys.Services.AuthenticationService.logout(null, null, OnCommunicationFailed, null);&amp;nbsp; If you want to redirect the user to a new page upon successful logout, then replace the first null with the location path.&amp;nbsp; If you leave it as null it will refresh the page upon successful logout.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Profile Service&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Now we will look at the profile service, which in my example is where the LoadProfile method call from the Authentication example above comes in.&amp;nbsp; And here it is:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;function&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; LoadProfile()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Sys.Services.ProfileService.load(&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;OnProfileLoadCompleted, OnProfileFailed, &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;BR&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;P mce_keep="true"&gt;It is farily sipmlye call.&amp;nbsp; What it does is call in the AJAX Extensions embedded web service to retrieve the profile properties that were specified in the web.config file.&amp;nbsp; How these properties are accessed can be seen in the OnProfileLoadCompleted method:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;function&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt; OnProfileLoadCompleted(numProperties, userContext, methodName)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;{&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$get("LoginBox").style.display = &lt;SPAN style="COLOR: #a31515"&gt;"none"&lt;/SPAN&gt;;&lt;BR&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;welcomeBox.innerHTML = &lt;SPAN style="COLOR: #a31515"&gt;"Welcome "&lt;/SPAN&gt; + Sys.Services.ProfileService.properties.Contact.Name + &lt;SPAN style="COLOR: #a31515"&gt;"&amp;lt;input type='button' value='logout' onclick='LogOut()'&amp;gt;"&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;__doPostBack(&lt;SPAN style="COLOR: #a31515"&gt;'UpdatePanel1'&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;''&lt;/SPAN&gt;);&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-CA; mso-fareast-language: EN-CA; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;P mce_keep="true"&gt;As you can see it is very easy to access profile properties as they simply become part of the properties property on the ProfileService object (the second line of the function).&amp;nbsp; Remember though that only the profile properties you specify in the web.config get exposed.&amp;nbsp; The&amp;nbsp;first line of the&amp;nbsp;method above hides the login box.&amp;nbsp; The second line replaces the login box with a welcome message that is personalized with the user's full name.&amp;nbsp; The last&amp;nbsp;line is interesting though.&amp;nbsp; Once you are logged in, you want to display content that is specific to being logged in.&amp;nbsp; How I did that in the website is refresh an AJAX UpdatePanel and that is what this line does.&amp;nbsp; The Postback functionality of ASP.NET gets "hijacked" by the AJAX Extensions so that if an Async trigger (the UpdatePanel Trigger collection defines these) or an UpdatePanel is the target of the Postback, it stops the regular post back and performs an Async callback and reloads the specified UpdatePanel.&lt;/P&gt;
&lt;P mce_keep="true"&gt;And that is basically my experience with Authentication and Profile Services within the AJAX Extensions.&amp;nbsp; Simple, but powerful.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4140049" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="Profile" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Profile/default.aspx" /><category term="Authentication" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Authentication/default.aspx" /><category term="UpdatePanel" scheme="http://weblogs.asp.net/adamgreene/archive/tags/UpdatePanel/default.aspx" /><category term="AJAX" scheme="http://weblogs.asp.net/adamgreene/archive/tags/AJAX/default.aspx" /></entry><entry><title>AJAX, Flash CS3, and Dynamic Javascript</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2007/09/11/ajax-flash-cs3-and-dynamic-javascript.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2007/09/11/ajax-flash-cs3-and-dynamic-javascript.aspx</id><published>2007-09-12T00:58:00Z</published><updated>2007-09-12T00:58:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Well, I've been having some fun with AJAX and Flash CS3.&amp;nbsp; Here is the scenario: &lt;/P&gt;
&lt;P mce_keep="true"&gt;I had 4 pages that were all the same basically except for a block of text.&amp;nbsp; Each of these pages had icons indicating short video clips (usually 4 per page).&amp;nbsp; When you clicked these icons, the screen would grey out and a picture of a flat screen TV would come up over the web page and play the video, you could click on the OK button and the video would stop, the TV go away and the web page would go back to normal.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;How I accomplished this was simply in the execution, but complex in the JavaScript :-)&amp;nbsp; I simply used the ModalPopupExtender from the AJAX Control Toolkit to grey out the screen and popup the TV (which was simply a picture).&amp;nbsp; In the middle of the TV, I put a Flash object to play the video.&amp;nbsp; When you clicked the icon, two events were fired.&amp;nbsp; The first one showed the Modal Popup, the second event sent a message via Flash's ExternalInterface to the Flash file telling it which video to play.&amp;nbsp; When you clicked the button to close the Modal window, it sent another message to flash (again via the ExternalInterface in flash) to stop playing the video.&amp;nbsp; This way, I didn't have to keep recreating / reloading the Flash file, it simply stayed in the page and starting the video was a fast and seemless process, until I tried to use AJAX, that is.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Like I said, the pages were the same except for a block of text and which videos the icons played.&amp;nbsp; Being that the pages are graphically heavy and take 3-6 seconds to load to begin with, I figured it was a good candidate for AJAX, and it was.&amp;nbsp; The load time for page changes went down to 1-2 seconds.&amp;nbsp; I was quite pleased with myself, I clicked one of the icons, and the ModalPopup worked!!&amp;nbsp; ... but the TV screen was "blank", there was a big hole where the Flash player should have been and Javascript was throwing errors.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;The issue was this:&amp;nbsp; &lt;STRONG&gt;When you update a block of text via AJAX that has embedded script tags, the script doesn't run.&lt;/STRONG&gt;&amp;nbsp; The way around this is to use the static methods on the ScriptManager class, specifically &lt;STRONG&gt;&lt;EM&gt;RegisterClientScriptBlock&lt;/EM&gt;&lt;/STRONG&gt;.&amp;nbsp; The problem with that is that script that Flash CS3 generates to get around the "Click or press spacebar" message relies on inlining the script in the page.&amp;nbsp; (Not the whole script, you make a method call to the function that produces the tags, but it does a document.write to insert the result at the point in the webpage where it was called).&amp;nbsp; So I opened up the Javascript file, found the point in the code where it did the document.write and added a bit of code to replace the &lt;EM&gt;innerHTML&lt;/EM&gt; of a target span (that could be specified as part of the list of parameters to the method).&amp;nbsp; I then placed a&amp;nbsp;span where I wanted the video to appear.&amp;nbsp; I could have gotten around this by placing the asp:Panel that made up the TV&amp;nbsp;outside of the UpdatePanel and&amp;nbsp;it would have worked as is, but that would be too easy :-)&amp;nbsp; Actually, I needed to clear the video&amp;nbsp;between pages (the Audio demos page would end up&amp;nbsp;with the last frame from the previous video showing as the audio demos are audio, not video, and flash&amp;nbsp;has a glitch in it that I could not clear the last frame from the previous video without without running a new video or reloading the page).&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;It may not sound like much.&amp;nbsp; But if you are not used to working with the strangeness that is embedded Javascript and AJAX UpdatePanels (not to mention that Flash itself is a little goofy).&amp;nbsp; Actually, let me explain that statement.&amp;nbsp; There is an issue in Flash CS3 where under Internet Explorer, the variable used to reference the Flash object doesn't get assigned (it has to do with the fact that when you create an element with an ID within a form, instead of creating a reference to it in the window object (ie.&amp;nbsp; window.NewPortfolio), it creates it within the form only (ie. document.forms[0].NewPortfolio)).&amp;nbsp; In my webpage, the Flash file is called NewPortfolio.swf, so I use an ID of NewPortfolio for the Flash object.&amp;nbsp; You need to know this ID name because you access the Flash ExternalInterface's methods by simply (in this case) saying NewPortfolio.playVideo([path to swf]), very much like PageMethods in AJAX Extensions.&amp;nbsp; So if the variable didn't get created in the correct place (on the window object), you get a ton of Javascript errors.&amp;nbsp; The way around this is right after you make the call to the Javascript that Adobe provides for inserting the Flash object, write a line like this:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;NewPortfolio = document.NewPortfolio&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;And everything goes back to working the way it's supposed to.&amp;nbsp; (To make matters even more weird, under certain circumstances you have to write "&amp;lt;form&amp;gt;&amp;lt;/form&amp;gt;" right inside your &amp;lt;form runat="server"&amp;gt; tag to make Flash work right as well.&amp;nbsp; I've managed to get around that by rewriting some of my HTML (what precisely I did, I can't remember.&amp;nbsp; That "fix" was several months ago) and as outlined above.&amp;nbsp; So I think that Adobe should really look at fixing this problem before in the next release of Flash (or maybe it's Microsoft's "problem", I never know who to blame :-)&lt;/P&gt;
&lt;P mce_keep="true"&gt;For more information see:&lt;BR&gt;&lt;A class="" href="http://asp.net/ajax/documentation/live/mref/M_System_Web_UI_ScriptManager_RegisterClientScriptBlock_5_0feb167c.aspx" target=_blank mce_href="http://asp.net/ajax/documentation/live/mref/M_System_Web_UI_ScriptManager_RegisterClientScriptBlock_5_0feb167c.aspx"&gt;ScriptManager.RegisterClientScriptBlock&lt;/A&gt;&lt;BR&gt;&lt;A class="" href="http://www.extremefx.com.ar/blog/fixing-flash-external-interface-inside-form-on-internet-explorer" target=_blank mce_href="http://www.extremefx.com.ar/blog/fixing-flash-external-interface-inside-form-on-internet-explorer"&gt;The Oddness of IE / Flash&lt;/A&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3831766" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="UpdatePanel" scheme="http://weblogs.asp.net/adamgreene/archive/tags/UpdatePanel/default.aspx" /><category term="AJAX" scheme="http://weblogs.asp.net/adamgreene/archive/tags/AJAX/default.aspx" /><category term="Javascript" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Javascript/default.aspx" /><category term="Flash" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Flash/default.aspx" /></entry><entry><title>Let me introduce myself</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/adamgreene/archive/2007/09/06/let-me-introduce-myself.aspx" /><id>http://weblogs.asp.net/adamgreene/archive/2007/09/06/let-me-introduce-myself.aspx</id><published>2007-09-06T19:48:00Z</published><updated>2007-09-06T19:48:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Good day ladies and gentlemen.&amp;nbsp; Welcome to today's meeting of Programmers Anonymous where we seek to help those who are addicted to programming.&amp;nbsp; My name is Adam Greene, and I am a programmer.&amp;nbsp; &lt;EM&gt;Hello Adam.&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Doesn't it feel at times like we like our work a little too much??&amp;nbsp; Maybe we are addicted to programming?&amp;nbsp; I'm not sure, but I know I'm really digging ASP.NET and all the other cool Microsoft technologies.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Let me back up for a minute and introduce myself.&amp;nbsp; My name is Adam Greene (which you already know), and I am the Lead Developer at &lt;A class="" title="Trimedia Atlantic Inc" href="http://www.trimediatlantic.com/" mce_href="http://www.trimediatlantic.com"&gt;Trimedia Atlantic Inc&lt;/A&gt;&amp;nbsp;(which you probably &lt;EM&gt;didn't&lt;/EM&gt; know).&amp;nbsp; Trimedia does everything from Video and Audio for television to Print management.&amp;nbsp; Basically we are a marketing company without the marketing part :-)&amp;nbsp; My job here is to help move our clients from traditional medias to "&lt;STRONG&gt;New Media&lt;/STRONG&gt;".&amp;nbsp; What is new media, you ask?&amp;nbsp; Good question.&amp;nbsp; It is really just a buzz word.&amp;nbsp; It means "take what you have always done and do it in&amp;nbsp;a new way / medium".&amp;nbsp; For us, it means moving our clients away from normal websites to what we call "Advanced Web Systems".&amp;nbsp; Our goal is to help our clients leverage their websites to increase their customer interaction, retention, and satisfaction through Web 2.0 technologies and Rich Internet Experience technologies.&amp;nbsp; Our technology of choice to that end is Microsoft ASP.NET, Silverlight, and Windows Presentation Framework.&amp;nbsp; Basically all things Microsoft.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The purpose of this blog will be to catalog my adventures in New Media and how we apply Microsoft technologies to our day to day development challenges.&amp;nbsp; I will also talk about Web 2.0 technologies in general, which will mean at times I will be talking about, dare I say it .... &lt;EM&gt;&lt;STRONG&gt;non&lt;/STRONG&gt;&lt;/EM&gt;-Microsoft technologies.&amp;nbsp; The reason for this is that my &lt;STRONG&gt;&lt;EM&gt;other&lt;/EM&gt;&lt;/STRONG&gt; day job is "Media Programming Instructor" at &lt;A class="" title="McKenzie College" href="http://www.mckenzie.edu/home.html" mce_href="http://www.mckenzie.edu/home.html"&gt;McKenzie College&lt;/A&gt;.&amp;nbsp; In the Media Programming course we will be teaching the students how to develop web games from start to finish in Flash CS3 / ActionScript 3.0 (along with basic E-Commerce, you can't make a penny at web games unless you have a website to put them in).&amp;nbsp; We will also be teaching them PHP and MySQL (I know, I know.&amp;nbsp; I tried to get them to teach MSSQL and ASP.NET, but being an "arts" college, they use Apple computers and are an Adobe licensed training center).&amp;nbsp; If someone offered to give them the same deal (hint, hint) on Intel / Microsoft, I'm sure I could convince them to go for it.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3768958" width="1" height="1"&gt;</content><author><name>ccm682</name><uri>http://weblogs.asp.net/members/ccm682.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/adamgreene/archive/tags/ASP.NET/default.aspx" /><category term="WPF" scheme="http://weblogs.asp.net/adamgreene/archive/tags/WPF/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/adamgreene/archive/tags/Silverlight/default.aspx" /></entry></feed>