David Barkol's blog

  • Window Phone 7 Unleashed Event Recap - Los Angeles

    Yesterday, I had the honor of presenting at a Windows Phone 7 Unleashed event in Los Angeles. The event consisted of a set of hands on labs (HOLs) and sessions that walked the attendees through the basics of creating applications on the phone. All the material was put together by Daniel Egan, one of our great local evangelists in Southern California. The application built during the labs, called Uncorked; integrated with Wine.com and demonstrated how to leverage launchers and choosers as well as the fundamentals of network calls from the phone: 

    Uncorked

    At the end of the event, a contest was held to see who could create the most interesting application within the allotted time. Some of the submissions were very creative, including one that was built with the XNA framework and leveraged a Wii Remote (aka wiimote) to move pieces around. Here are some, but not all of the submissions:

    WinPhone Game (Wii Remote):

    DSC_0758   DSC_0756

    Movie Meteor:

    DSC_0743

    Coin Toss:

    DSC_0744

    Flickr:

    DSC_0748

    Stock Wave:

    DSC_0750

    Weather Forecast:

    DSC_0760

    If you are interested in attending one of these events in your area, check out msdn events.

     

    Read more...

  • Asynchronous error handling change in ASP.NET AJAX 3.5

    There is a subtle change in the .NET 3.5 release of the Microsoft Ajax Library that might catch some developers by surprise when handling asynchronous postback errors. The change can be found at the end of the endPostBack function of the PageRequestManager object. In the first release of the Ajax library, if an error was not handled on the client; an alert box was used to convey to the user the error message:

    Read more...

  • ASP.NET 3.5 Extensions History Control Tip

    Originally introduced in the ASP.NET Futures package, the history control in the ASP.NET 3.5 Extensions preview comes with a few nice additions. One of the updates is the ability to change the page title when adding a history point. This is important because without updating the title, the history list isn't very much help after a few updates. To illustrate the problem, here is what the history list in IE could look like after adding a few history points:

    Read more...

  • SSL Support for Virtual Earth is here

    If you've ever placed a Virtual Earth map or Google map on an HTTPS page then you're probably familiar with the mixed content message that appears when the page loads:

    While there are workarounds for this in the browser settings, the solution isn't really scalable. The good news it that Virtual Earth 6 now offers support for SSL pages. All that we have to do is update the script reference like so:

    <script type="text/javascript" 
      src="https://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6&s=1">
    </script> 

    Notice how the source path now begins with https and the version is set to 6. Also, there is the additional parameter at the end, s=1; that flags the request accordingly.

    If you're using ASP.NET AJAX and have a ScriptManager on the page, then your reference can look something like this:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
      <Scripts>
        <asp:ScriptReference Path="https://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6&s=1" />
      </Scripts>
    </asp:ScriptManager>

    This seems like a subtle change, but both Google and Virtual Earth have lacked this type of support for years. For anyone building enterprise applications that require HTTPS, this is something we've been asking and waiting for, for quite some time.

    Read more...

  • ASPInsiders

    Recently, along with a few others, I've received the honor of joining the ASPInsiders. It has been a true privilege being a part of such a talented and great group and I look forward to sharing and learning from them as much as possible.

    ASPInsiders

    Read more...

  • Great WCF Tips from David Pallmann

    The best part about working at Neudesic is the interaction you get with some of the most talented people in the industry. Recently, David Pallmann, one of our Architect Consultants, posted an invaluable series of blogs posts on WCF tips. Here are the links to his most recent posts: 

    WCF Tips #1 - Service Interface Design

    WCF Tips #2 - Service Class Design

    WCF Tips #3 - Service Hosting

    WCF Tips #4 - Configuration

    WCF Tips #5 - Infrastructure

    WCF Tips #6 - Instrumentation

    WCF Tips #7 - Clients

    To gain some real-world insight into WCF, check out these tips and subscribe to David's blog!

    Read more...

  • ASP.NET AJAX Role Application Service – Visual Studio 2008 (Orcas)

    The first version ASP.NET AJAX gave us client-side support for two application services – profile and authentication. In Visual Studio 2008 (Orcas), an additional built-in service has been added: roles. If you’ve downloaded Eilon’s ASP.NET AJAX JavaScript Class Browser and installed the beta 2 (or beta 1) version of .NET 3.5, then you’ll find the new service under the Sys.Services namespace:

     

    Adding support for the role service

    If you’re upgrading an ASP.NET 2.0 web site to .NET 3.5 and want to leverage this new built-in service, you’ll have to make a few minor adjustments to web.config (new web sites in .NET 3.5 will already have these configurations). The first change requires adding the role service to the sectionGroup of the configuration settings:

    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
      <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
      <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
      <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
    </sectionGroup>

    Next, you need to enable the service from the list of web services under system.web.extensions:

    <system.web.extensions>
      <scripting>
        <webServices>        
          <authenticationService enabled="true" requireSSL = "false"/>         
          <profileService enabled="true" />
          <roleService enabled="true"/>
        </webServices>        
        <scriptResourceHandler enableCompression="true" enableCaching="true" />
      </scripting>
    </system.web.extensions>

    Interfacing with the service is done through a variable called Sys.Services.RoleService. The actual implementation is an object called Sys.Services._RoleService. The application services in ASP.NET AJAX use this pattern to provide a singleton-like access point. Here is an example of a call to the load and isUserInRole methods of the role service:

    function pageLoad(){                          
        loadRoles();                         
    }
    function loadRoles(){               
        Sys.Services.RoleService.load(onLoadRolesCompleted, onLoadRolesFailed, null);        
    }
    
    function onLoadRolesCompleted(result, userContext, methodName){                                        
        if (Sys.Services.RoleService.isUserInRole("Administrator")){
            $get("adminView").style.display = "block";            
        }
    }
    
    function onLoadRolesFailed(error, userContext, methodName){
        alert(error.get_message());
    }

    As an alternative to calling the isUserInRole method, you can also retrieve a comma delimited list of roles for the user from the roles property:

    Sys.Services.RoleService.get_roles();

    Click here (requires SQL Express) for a working sample that demonstrates the use of all three services.

    Read more...

  • Web Inspector for Safari on Windows

    If you've downloaded Safari for Windows and are a looking for a tool similar to Firebug or Nikhil's Web Development Helper, then you might be interested in the WebKit Open Source Project. Within the project is a tool call Web Inspector that performs much of the same tasks as the tools mentioned earlier. To run the tool:

    1) Download the nightly build from http://nightly.webkit.org/.

    2) Extract the contents from the zip file.

    3) If you are running Vista then you will have to add the following to the end of the Preferences.plist file (under C:\Users\<UserName>\AppData\Roaming\Apple Computer\Safari\), just before </dict></plist>: 

              <key>WebKitUserStyleSheetLocationPreferenceKey</key> <true/>

    4)  Execute the run-nightly-webkit.cmd file. This will launch Safari from the command prompt.

    After Safari is launched you will have an additional item in the context menu called 'Inspect Element', select this to see the tool:

     Here are a few screenshots of it in action:

     

    Read more...