Archive for August, 2009

Code Cast 31 – Agile for Families

This episode is a recording I made during my talk at the Agile 2009 conference in Chicago. The session, “Agile for Families, Iterating with Children”, was surprisingly popular. In addition to the slides and the audio, I am including a link to the IEEE paper that went along with this session. That’s right! There is an IEEE paper about Agile at home. Awesome :)

The slides from the talk are available below. The slide deck I am posting here is a bit larger than the one used in the talk. These slides include some interviews with the Starr kids that were left out of the slides at the conference for time reasons.

This episode is less rocket surgery, and more brain science. I hope you enjoy the show.

Get the show here

View in iTunes Any Podcatcher


Odd/Even Looping in ASP.NET MVC

Ran into a post from Scott Sandersen earlier in which he laments the verbosity of doing things like odd/even parsing in an iterative loop in ASP.NET MVC. Steve proceeds to show an abstract solution which is a great idea for more complex scenarios, but if all you need is odd even type parsing may be a bit of overkill especially since it such a common scenario.

I tend to use a slightly simpler approach for odd even figuring based on a logical variable that’s changed in a loop. Here’s what my version of similar code looks like:

    <% bool oddEven = true;
       foreach (CodeSnippetListItem snip in snippetList)
       {  %>
       
        <div class="<%= (oddEven = !oddEven) ? "evenclass" : "oddclass" %>">
            Content goes here...
        </div>
    <% } %>

That’s not too bad to read as far as tag soup goes. The key is a logical var that is simple ‘not-ed’ – this can be done after the { or as I’ve done here direclty inline of the expression. The only hard part with this code is figuring out whether it starts on odd or even :-}

Another option is to use some client script code – jQuery can make short work of applying classes after the page’s been loaded.

<script type="text/javascript">
    $(document).ready(function() {
        $(".snippet:odd").addClass("listalternate");
    });    
</script>

Given the two approaches I think the former is the better choice because I like to keep the display at the point where it’s applied in the HTML or style sheet and just in case JavaScript doesn’t work the display is consistent either way.

Options are good though…

© Rick Strahl, West Wind Technologies, 2005-2009
Posted in MVC  
kick it on DotNetKicks.com


DevExpress Nominated for 2009 Community Choice Awards; Vote Now!

Windows IT Pro and SQL Server Magazine are conducting the 2009 community choice awards. We’d really appreciate your votes for DevExpress.

2009 Community Choice AwardsSpend about 30 seconds and please cast your votes for DevExpress. We’re nominated in the following categories:

On page one:

5. Best Business Intelligence & Reporting Product - DevExpress XtraReports Suite

10. Best Development Tool - DevExpress CodeRush

On page two:

32. Best Free or Open Source IT Tool - DevExpress CodeRush Express

If you’re wondering why DevExpress wasn’t nominated for a particular category then add your own DevExpress product by using the “Other (please specify)” textbox under each category. For example:

33. Best Vendor Tech Support – [Other (please specify): DevExpress]

Be sure to fill out the last category (#34) with your name and email address. This allows them to weed out fraudulent or duplicate votes and you could win some cash or prizes.

Thank you for your voting support! Click here to vote now for DevExpress!


Memory Management with the Dictionary Object

In my previous article I detailed the architecture for a video player that would switch between multiple players, using composition to support the same interface across each layer of the architecture. The architecture worked out really well, but when I...

New Poll: The Best of RIA 2009 – Semi Finals

Over the past 3+ weeks we have done the following. First, we asked you to "Help us choose the best RIA of 2009 / Adobe MAX". Next, we took 20 of those nominations and split them into 2 groups...

  • Sponsored Links

  •  

    August 2009
    M T W T F S S
    « Jul   Sep »
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31  
  • .

    Copyright © 1996-2010 Answer My Query. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress