# Wednesday, 15 December 2010

With lots of goodies in it. Feels like Santa’s early this year Smile.

This is taken from the overview of the download page:

The Windows Azure Platform Training Kit includes a comprehensive set of technical content including hands-on labs, presentations, and demos that are designed to help you learn how to use the Windows Azure platform including: Windows Azure, SQL Azure and the Windows Azure AppFabric.
The December update provides new and updated hands-on labs, demo scripts, and presentations for the Windows Azure November 2010 enhancements and the Windows Azure Tools for Microsoft Visual Studio 1.3. These new hands-on labs demonstrate how to use new Windows Azure features such as Virtual Machine Role, Elevated Privileges, Full IIS, and more. This release also includes hands-on labs that were updated in late October and November 2010 to demonstrate some of the new Windows Azure AppFabric services that were announced at the Professional Developers Conference (http://microsoftpdc.com) including the Windows Azure AppFabric Access Control Service, Caching Service, and the Service Bus.
Some of the specific changes with the December update of the training kit include:

  • [Updated] All demos were updated to the Azure SDK 1.3
  • [New demo script] Deploying and Managing SQL Azure Databases with Visual Studio 2010 Data-tier Applications
  • [New presentation] Identity and Access Control in the Cloud
  • [New presentation] Introduction to SQL Azure Reporting
  • [New presentation] Advanced SQL Azure
  • [New presentation] Windows Azure Marketplace DataMarket
  • [New presentation] Managing, Debugging, and Monitoring Windows Azure
  • [New presentation] Building Low Latency Web Applications
  • [New presentation] Windows Azure AppFabric Service Bus
  • [New presentation] Windows Azure Connect
  • [New presentation] Moving Applications to the Cloud with VM Role

Grz, Kris.

Wednesday, 15 December 2010 14:48:00 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, 10 December 2010

Since several months now I’m one of the board members of Azug, the Belgian Windows Azure User Group. Feweb, the Belgian organisation for web developers/designers, loved to put several Belgian user groups in the spotlight and asked them to give a short presentation about their workings, their common intrest, … Since I enjoy giving presentations I signed myself up and gave the following slidedeck:

If you’re from Belgium, or passing by in our lovely country, and we have a meeting planned then simply sign up and come over. We like you to be there!

Grz, Kris.

Friday, 10 December 2010 02:56:00 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, 30 November 2010
Microsoft released a new SDK and toolset for Windows Azure, currently version 1.3. Be sure to check it out:
Tuesday, 30 November 2010 20:11:45 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Saturday, 20 November 2010

ASP.NET provides developers with some very handy controls like a Treeview or a Menu control for displaying data coming from a sitemap file. Though a very common scenario sometimes these are simply too heavy weight to be used and on the ASP.NET forums I simply suggest an alternative by using a simple DataList control. For future reference to point out on the forums I decided to write this little code snippet:

The sitemap file:

<?xml version="1.0" encoding="utf-8" ?>
<
siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
>
    <
siteMapNode url="" title=""  description=""
>
        <
siteMapNode url="http://www.microsoft.com" title="Microsoft"  description=""
/>
        <
siteMapNode url="http://blog.krisvandermast.com" title="Kris' blog"  description=""
/>
    </
siteMapNode
>
</
siteMap
>

The markup of a simple ASP.NET webform:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns
="http://www.w3.org/1999/xhtml">
<
head runat="server">
    <title></title>
    <style type="text/css">
   
    li {
        border-left:2px solid #000;
        list-style:none;
        margin-right:10px;
        padding-left:10px;
        float:left;
    }
   
    </style
>
</
head
>
<
body>
    <form id="form1" runat="server">
    <div>
        <asp:SiteMapDataSource runat="server" ID="smd" ShowStartingNode="false" />
        <asp:DataList runat="server" ID="menu" DataSourceID="smd" RepeatDirection="Horizontal" RepeatLayout="Flow">
            <HeaderTemplate>
                <ul>
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>' 
                        Text='<%# Eval("Title") %>'></asp:HyperLink>
                </li>
            </ItemTemplate>
            <FooterTemplate>
                </ul>
            </FooterTemplate>
        </asp:DataList>
    </div>
    </form
>
</
body
>
</
html
>

The output:

datalist_sitemap_menu

The benefits of using the DataList control is that it’s versatile, lightweight, easy to program but also that it supports item selection. That Could be quite an asset when a page wants to set the SelectedIndex from codebehind to have selection in the menu itself. Note the extra added SelectedItemTemplate and the added class=”selected” in the <li> element. This will, thanks to the css class, make the background color look red and as such a selected menu item.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns
="http://www.w3.org/1999/xhtml">
<
head runat="server">
    <title></title>
    <style type="text/css">
        li {
            border-left: 2px solid #000;
            list-style: none;
            padding-right: 10px;
            padding-left: 10px;
            float: left;
        }
       
        .selected {
            background-color:Red;
        }
    </style
>
</
head
>
<
body>
    <form id="form1" runat="server">
    <div>
        <asp:SiteMapDataSource runat="server" ID="smd" ShowStartingNode="false" />
        <asp:DataList runat="server" ID="menu" DataSourceID="smd" RepeatDirection="Horizontal"
            RepeatLayout="Flow">
            <HeaderTemplate>
                <ul>
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>' 
                        Text='<%# Eval("Title") %>'></asp:HyperLink>
                </li>
            </ItemTemplate>
            <SelectedItemTemplate>
               <li class="selected">
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>' 
                        Text='<%# Eval("Title") %>'></asp:HyperLink>
                </li>
            </SelectedItemTemplate>
            <FooterTemplate>
                </ul>
            </FooterTemplate>
        </asp:DataList>
    </div>
    </form
>
</
body
>
</
html
>

And in the Page_Load event:

protected void Page_Load(object sender, EventArgs e)
{
    menu.SelectedIndex = 1;
}

This outputs the following:

datalist_sitemap_menu2

Another option, which generates less span elements would be to use a Repeater control instead:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<%@ Register assembly="WebApplication1" namespace="WebApplication1" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns
="http://www.w3.org/1999/xhtml">
<
head runat="server">
    <title></title>
    <style type="text/css">
   
    li {
        border-left:2px solid #000;
        list-style:none;
        margin-right:10px;
        padding-left:10px;
        float:left;
    }
   
    </style
>
</
head
>
<
body>
    <form id="form1" runat="server">
    <div>
        <asp:SiteMapDataSource runat="server" ID="smd" ShowStartingNode="false" />
        <div id="menu">
            <asp:Repeater runat="server" ID="rpt" DataSourceID="smd">
                <HeaderTemplate>
                    <ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>' 
                            Text='<%# Eval("Title") %>'></asp:HyperLink>
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    </ul>
                </FooterTemplate>
            </asp:Repeater>
        </div>
    </div>
    </form
>
</
body
>
</
html
>

Grz, Kris.

ASP.NET | CSS | Datalist | Sitemap
Saturday, 20 November 2010 20:20:25 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, 16 November 2010

Recently Microsoft presented quite a lot of sessions on PDC10. Unfortunately for a lot of adepts there was one technology missing somewhat: Silverlight. Quite soon a lot of news was spread around that Silverlight was dead or near to death… Not so actually. Microsoft apparently took the time to brew some new stuff for Silverlight vNext and will have a full dedicated day of presentations during the Silverlight Firestarter on December 2nd.

Silverlight-Firestarter-2-December-2010-LandingPage-Banner

The following agenda will dominate this exciting day jam packed with demos:

Time Presenter Session Details
8:00 am   Breakfast
9:00 am Scott Guthrie  Scott Guthrie The Future of Silverlight
10:45 am Jesse Liberty  Jesse Liberty Data Binding Strategies with Silverlight and WP7
11:30 am Yavor Georgiev  Yavor Georgiev Building Compelling Apps with WCF using REST and LINQ
12:15 pm alt Lunch
1:00 pm Dan Wahlin  Dan Wahlin Building Feature Rich Business Apps Today with RIA Services
1:45 pm John Papa  John Papa MVVM: Why and How? Tips and Patterns using MVVM and Service Patterns with Silverlight and WP7
2:45 pm Tim Heuer  Tim Heuer Tips and Tricks for a Great Installation Experience
3:30 pm Scott Guthrie   Mike Cook &
  Jossef Goldberg
Tune Your Application: Profiling and Performance Tips
4:30 pm Jaime Rodriguez  Jaime Rodriguez Performance Tips for Silverlight Windows Phone 7
5:15 pm alt After Party!
Keynote : The Future of Silverlight

Be first to hear the official news about what’s coming up next for Silverlight from Scott Guthrie, Microsoft Corporate Vice President.

Data Binding In Silverlight and Windows Phone

Jesse Liberty walks us through the fundamentals of data binding, including binding to traditional and non-traditional data sources, binding to elements, binding in both Visual Studio and Blend, binding in code, data conversion and much more.

Building Compelling Apps with WCF using REST and LINQ

In this session we will cover how to build a WCF-based backend web service to provide data to the Silverlight application. We will demonstrate the use of LINQ in the service to retrieve objects from our database, and cover some details of how those objects are serialized to Silverlight. We will cover the use of faults for debugging and for driving production logic, as well as authentication strategies for internet and intranet deployment. We will finish with a look at how to access third-party REST/HTTP-based services from Silverlight.

Building Feature Rich Business Apps Today with RIA Services

Silverlight provides many different options for accessing distributed data including Web Services, REST APIs, sockets and more. This talk will walk you through the benefits that WCF RIA Services offers and demonstrate how it can be used to simplify n-tier programming and provide a flexible and productive way to access, validate and modify data in Silverlight applications. Topics covered include creating a domain service, simplifying asynchronous programming with the domain context, leveraging object tracking features, sharing data validation code between the client and server and writing domain services that can be used with any backend data access technology.

MVVM: Why and How? Tips and Patterns using MVVM and Service Patterns

See how good patterns and practices apply to Silverlight applications on the desktop, in the browser or on the phone. Learn how to integrate MVVM, Service Providers, design time data (aka Blendability), into your Silverlight applications to promote code reuse and create a highly maintainable application.

Tips and Tricks for a Great Installation Experience

Tired of seeing the spinning blue balls from Silverlight as the application loads? Your users probably are as well. The simple fact is that it is very easy to customize your complete application installation experience down to the plugin level. During this session you’ll see understand how Silverlight works with install/upgrade scenarios and how you can completely customize the installation experience. Additionally you’ll see custom ‘splash screen’ demonstrations on what you can do to further brand your application. If you are building an out-of-browser application with Silverlight we’ll discuss and demonstrate some of the tips/tricks to provide a good acquisition experience there as well and some tricks on automatically installing applications.

Tune Your Application: Profiling and Performance Tips

There are some common pitfalls that can negatively impact your Silverlight application’s performance. In this session we’ll demonstrate how to use some of the tools that are available to profile and identify performance issues. We’ll cover the available techniques with the performance tools that can help you to analyze your Silverlight application memory usage, rendering and CPU usage to help improve performance and avoid those common pitfalls.

Performance Tips for Silverlight Windows Phone 7

This will be a comprehensive deep-dive into Windows Phone performance. We will begin with the threading model changes and optimizations made to Silverlight run-time to take advantage of the GPU on the phone; we will then cover the most common pitfalls, the troubleshooting techniques, and close with the workarounds to create snappy Windows phone applications.

Grz, Kris.

Tuesday, 16 November 2010 19:13:48 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, 28 September 2010

Today I went to Remix10 in Affligem. Due to some crazy traffic jams I missed a part of the keynote but was in time to see Katrien De Graeve jump in front of the new Kinect Smile.

The sessions which I followed were the one about IE9 beta, Sketchflow, putting an existing application into the cloud and the WebPI session. I mostly enjoyed the sessions about IE9/HTML5 and putting stuff in the cloud as these affect my day to day development endeavors the most. I already installed IE9 beta and like the new look & feel and the speed it runs with. For me that’s quite important as web applications are more and more becoming “heavyweight” ajaxised brower applications who call out from time to time to some service running on the server for updating data or extra retrieval. I just only can hope that Microsoft pushes it down to every pc running Windows (every web developer would love to see IE6/7 put to rest).

During the pause I finally had the chance to play with the new Kinect and I must say, it was fun to do so. I’m already looking forward to another Remix event next year, and who knows, perhaps I might make it to the real one in Las Vegas (would be great).

Grz, Kris.

Tuesday, 28 September 2010 23:45:00 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
# Saturday, 18 September 2010

A couple of days ago I became aware of the following article: Security Hack Exposes Forms Authentication in ASP.NET. That never sounds good and Microsoft swiftly crafted a workaround to mitigate the attack. It simply consists of changing your web.config and adding a file with some piece of code in it.

For ASP.NET 1.0 to 3.5 use this adjustment:

<configuration>        
   <system.web>
      <customErrors mode="On" defaultRedirect="~/error.html" />
   </system.web>       
</configuration>

For ASP.NET 3.5SP1 and 4.0 use this adjustment:

<configuration>
   <system.web>
     <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/error.aspx" />
   </system.web>
</configuration>

You’ll also need to put that error.aspx page on your server with the following content:

VB version:

<%@ Page Language="VB" AutoEventWireup="true" %>
<%@ Import Namespace="System.Security.Cryptography" %>
<%@ Import Namespace="System.Threading" %>

<script runat="server">
    Sub Page_Load()
        Dim delay As Byte() = New Byte(0) {}
        Dim prng As RandomNumberGenerator = New RNGCryptoServiceProvider()
       
        prng.GetBytes(delay)
        Thread.Sleep(CType(delay(0), Integer))
       
        Dim disposable As IDisposable = TryCast(prng, IDisposable)
        If Not disposable Is Nothing Then
            disposable.Dispose()
        End If
    End Sub
</script>

<html>
<head runat="server">
    <title>Error</title>
</head>
<body>
    <div>
        Sorry - an error occured
    </div>
</body>
</html>

C version:

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Security.Cryptography" %>
<%@ Import Namespace="System.Threading" %>

<script runat="server">
   void Page_Load() {
      byte[] delay = new byte[1];
      RandomNumberGenerator prng = new RNGCryptoServiceProvider();

      prng.GetBytes(delay);
      Thread.Sleep((int)delay[0]);
       
      IDisposable disposable = prng as IDisposable;
      if (disposable != null) { disposable.Dispose(); }
    }
</script>

<html>
<head runat="server">
    <title>Error</title>
</head>
<body>
    <div>
        An error occurred while processing your request.
    </div>
</body>
</html>

Grz, Kris.

Saturday, 18 September 2010 13:49:57 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [15]  | 
# Thursday, 16 September 2010

Just read on the Gu’s blog that the developer tools for Windows Phone 7 got released. That’s great news!

Unfortunately for my free time that means another technology stack to take a look at soon. If you’re interested here’s already some links to check out:

Grz, Kris.

Thursday, 16 September 2010 20:44:43 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Play in a more beautiful web, explore Internet explorer 9 Beta. It’s great to see that Microsoft reveals its newest browser to the world.

There’s quite a lot of new and exciting stuff going on in IE9 like:

  • Streamlined design
  • Pinned sites (Windows 7)
  • Download manager
  • Enhanced tabs
  • A new tab page (with color coding for ease of use)
  • You can now search in the address bar
  • A new notification bar
  • An add-on performance advisor (which add-on makes your browser go slow?)

Grz, Kris.

Thursday, 16 September 2010 04:56:39 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Saturday, 11 September 2010

On Wednesday I performed a presentation about WebMatrix and its components: Razor syntax, the WebMatrix IDE, SQL CE and IIS Express. All great products created by Microsoft.

Here are the slides:

Grz, Kris.

Saturday, 11 September 2010 19:42:47 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |