Monthly Archives

6 Articles

Posted by .Ronald on

Creating an Outlook Navigation Bar using the ListView and Accordion Controls

Matt Berseth explains how to create an Outlook like navigation pane in ASP.Net with a combination of an Accordion Ajax Control and the ListView control.
Nice example of how the new Ajax controls in the ASP.NET Ajax Control Toolkit can extend the user experience of regular ASP.Net applications with a minimum of code.

One of the designers on our UI team requested a screen mockup with a page layout that is similar to your typical email client. The page is divided vertically into 2 panes. The left pane contains a 2 level hierarchy of categories and subcategories. As the user selects different subcategories the designer wants the right pane’s content to be updated with the corresponding information. Just like Outlook, the designer wants the subcategories to be displayed within expanding and collapsing panels.

Matt Berseth: Creating an Outlook Navigation Bar using the ListView and Accordion Controls

Posted by .Ronald on

Rhino Mocks Quick Reference

Last week I gave a presentation on mock objects for Software Professionals of Alaska. Once the PowerPointy hand-waving was out of the way, I illustrated the concepts with code examples using Rhino Mocks. I thought I was well-versed in Rhino Mocks before I started, but in the process of preparing the presentation I realized there was a lot that I didn’t know or had forgotten. So I distilled all the main facts and features down into a 3-page quick reference of tables and example usage. You might argue that 3 pages makes it a ‘slow reference,’ but regardless I still think it’s useful to see all the basics stripped down to the bare minimum. Much of the content came from the Rhino Mocks Documentation Wiki, so look there first if you need more details on a particular feature.

Oran DennisonRhino Mocks Quick Reference

Posted by .Ronald on

Copy project files to another location after build

For a (web-)project I am working on, I needed to copy the content of 1 website to a sub-folder of another website after the project was built. This enables the 2 projects being separately developed and deployed, but also allows the one project being deployed as a sub-site of the other one. Got it? 🙂

This is how I did this:
In the project file of the sub-project:

  1. In the project file I defined a few variables to make things easier
    <PropertyGroup>
    <MyOutputFolder>C:ProjectOutputFolder</MyOutputFolder>
    <OutputSubFolder>SubFolder</OutputSubFolder>
    </PropertyGroup>
  2. I defined what files to copy, with the binary output (dll) separately from the website content:
    <ItemGroup>
    <MyCopyItems Include="$(MSBuildProjectDirectory)***.aspx" />
    <MyCopyItems Include="$(MSBuildProjectDirectory)***.htm?" />
    <MyCopyItems Include="$(MSBuildProjectDirectory)***.js" />
    <MyCopyItems Include="$(MSBuildProjectDirectory)***.gif" />
    <MyCopyItems Include="$(MSBuildProjectDirectory)***.jp?g" />
    <MyCopyItems Include="$(MSBuildProjectDirectory)***.png" />
    <MyCopyBin Include="$(MSBuildProjectDirectory)bin***.dll" />
    </ItemGroup>
  3. I created a new target that performs 2 copy commands, one for the binaries and one for the content:
    <Target Name="MyPostBuildTarget">
    <Copy SourceFiles="@(MyCopyItems)"
    DestinationFiles="@(MyCopyItems->'$(MyOutputFolder)$(OutputSubFolder)%(RecursiveDir)%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(MyCopyBin)"
    DestinationFolder="$(MyOutputFolder)bin" />
    </Target>
  4. I added this target to the BuildDependsOn property so that it is executed everytime the project is built:
    <BuildDependsOn>$(BuildDependsOn);MyPostBuildTarget</BuildDependsOn>

This gives something like:

<!-- Copy project output to defined folder -->
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn);MyPostBuildTarget</BuildDependsOn>
<MyOutputFolder>C:ProjectOutputFolder</MyOutputFolder>
<OutputSubFolder>SubFolder</OutputSubFolder>
</PropertyGroup>
<ItemGroup>
<MyCopyItems Include="$(MSBuildProjectDirectory)***.aspx" />
<MyCopyItems Include="$(MSBuildProjectDirectory)***.htm?" />
<MyCopyItems Include="$(MSBuildProjectDirectory)***.js" />
<MyCopyItems Include="$(MSBuildProjectDirectory)***.gif" />
<MyCopyItems Include="$(MSBuildProjectDirectory)***.jp?g" />
<MyCopyItems Include="$(MSBuildProjectDirectory)***.png" />
<mycopybin include="$(MSBuildProjectDirectory)bin***.dll" />
</ItemGroup>
<Target Name="MyPostBuildTarget">
<Copy SourceFiles="@(MyCopyItems)"
DestinationFiles="@(MyCopyItems->'$(MyOutputFolder)$(OutputSubFolder)%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(MyCopyBin)"
DestinationFolder="$(MyOutputFolder)bin" />
</Target>

Some references on copying project files with MSBuild:
MSDN MSBuild Reference – Copy Task
Channel 9 Wiki: Copy Built Output Of A Visual Studio Project
SharpDevelop Community – Copy config post build
How To: Insert Custom Process at Specific Points During Build
How To: Add Custom Process at Specific Points During Build (Method #2)