garyshort.org


I am a Technical Evangelist for Developer Express, my work blog is here but this one is more fun. :-)

March 2008 Entries

Google Goes Green

Well at least for a little while. This is kind of cool...

GoogleGoesGreen

Technorati tags:

Remember, Vote Early and Vote Often

Okay, I'm kidding but...

It’s that time of year again – ASP.NET Pro Magazine is conducting its annual Readers Choice Awards and we’ve been nominated in 8 different categories.

Best Add-In: CodeRush/Refactor!

Best Charting: XtraCharts Suite

Best Component Set: DXperience

Best Grid: ASPxGridView

Best Navigation Suite: ASPxNavBar

Best Online Editor: ASPxHTML Editor

Best Printing/Reporting: XtraReports

Best Scheduling: ASPxScheduler

To cast your vote for your favorite DevExpress products, please visit http://www.aspnetpro.com/ReadersChoice/Default.asp

Voting takes a couple of minutes and as in politics, every vote counts…so if you are satisfied with the products we deliver to market and have the time, we’d appreciate your vote. Voting ends on April 10, 2008.

As always, we appreciate the faith and confidence you’ve placed in DevExpresss.

Technorati tags: ,

Last Night at the ALUG

Well last night's talk at the Abertay Linux User's Group went off okay, despite a small technical difficulty in getting my Ubuntu laptop to talk to the projector. In the end we got something on the screen and I spoke to the audience on writing secure software, which seemed to go down pretty well. I think I will port the examples to .Net and offer it as a DDD session.

I was chatting to a few of the guys in the bar afterwards (as you do) and one of them was raving about a new CI solution called Hudson which I'm going to look into when I get a spare minute.

Late Notice Speaking Event

On Thursday (March 27) I'll be speaking at the Abertay Linux User's Group on the subject of writing secure software. The meeting will be held in the 3rd floor cinema of the Abertay University Student's Union at 7pm. If the subject matter interests you, feel free to pop along.

How to Add Users to Roles Using the CreateUserWizard

For some reason, when you use the CreateUserWizard control in Visual Studio 2008, there is no built in method of adding the new user to existing roles that you have set up. You have to customize the wizard to do this for you. To achieve this customization, do the following:-

Firstly, in the create user step add listbox control to hold the existing roles. Next, in the page load event handler, fill the listbox with the roles you have already created, and for good measure, select the first role for the user, like so:-

protected void Page_Load(object sender, 
    EventArgs e)
{
    //GS - Fill the listbox with the 
    //available roles
    ListBox AvailableRoles = 
        CreateUserWizard1.CreateUserStep.
            ContentTemplateContainer.
                FindControl("RolesListbox") 
                    as ListBox;

    AvailableRoles.DataSource = 
        Roles.GetAllRoles();

    AvailableRoles.DataBind();

    //GS - Select first item in list
    if (AvailableRoles.Items.Count > 0)
    {
        AvailableRoles.Items[0].Selected = true;
    }
}

Then, in the created user event handler, add the new user to the selected roles, like so:-

protected void CreateUserWizard1_CreatedUser(
    object sender, EventArgs e)
{
    //GS - Add the newly created user to the 
    //selected roles
    ListBox AvailableRoles =
        CreateUserWizard1.CreateUserStep.
            ContentTemplateContainer.
                FindControl("RolesListbox") 
                    as ListBox;

    for (int i = 0; i < 
        AvailableRoles.Items.Count; i++)
    {
        if (AvailableRoles.Items[i].Selected)
        {
            Roles.AddUserToRole(
                CreateUserWizard1.UserName, 
                    AvailableRoles.Items[i].Value);
        }
    }
}

There is another way to do it (isn't there always?) You can also create a custom step in the CreateUserWizard to selected the Roles for the User and you can specify the Activate and Deactivate event handlers for this step, like so:-

<asp:WizardStep runat="server" 
    Title="Select User's Role" 
    OnActivate="ActivateStep" 
    OnDeactivate="DeactivateStep">
    Select the Role(s) for this User<br />
    <asp:ListBox ID="AvailableRoles" 
    runat="server"></asp:ListBox>
</asp:WizardStep>

This means that the code the you write in the event handlers is slightly simplified compared to that above.

protected void ActivateStep(object sender, 
    EventArgs e)
{
    AvailableRoles.DataSource = 
        Roles.GetAllRoles();
    AvailableRoles.DataBind();

    if (AvailableRoles.Items.Count > 0)
    {
        AvailableRoles.Items[0].
            Selected = true;
    }
}

protected void DeactivateStep(object sender, 
    EventArgs e)
{
    if (AvailableRoles.SelectedIndex >= 0)
    {
        Roles.AddUserToRole(
            CreateUserWizard1.UserName, 
            AvailableRoles.SelectedValue);
    }
}
Technorati tags: ,

New Job with Developer Express

Well it's official, I am now a Technical Evangelist for Developer Express! I'm thrilled to be joining the company and really pleased with this role. The role is a little fluid so you'll probably see me popping up all over the place, but one of the things I'll be doing is continuing to visit as many user groups etc as I can, so if you'd like me to visit your user group leave a comment here or contact me via Twitter.

WCSF Under Visual Studio 2008 and Vista

If you are running the Web Client Software Factory under Visual Studio 2008 and Vista, when using the the built in development server you may get a "failed to map path '/' error". If so, its an known issue which is described here, along with a workaround.

The Most Useless Error Message Ever?

Currently I'm struggling with the Web Client Software Factory. I have it working on my XP machine but not on my Vista laptop. So I thought I'd uninstall the WCSF and its dependents and try a reinstall to see if that helped. When trying to uninstall the Guidance Automation Toolkit for Visual Studio 2008 the following dialog box was displayed:-

ErrorMessage

Developer Day Scotland

Colin and the gang have been working hard over the weekend and the agenda and delegate registration for Developer Day Scotland (May 10th 2008) is now up. I'll be there speaking about the Web Client Software Factory, but don't let that put you off, it's sure to be a great day!

Screencast Glasgow Grok Talk

I decided to screencast last night's grok talk as the format seems perfect for a screencast. This one is an explanation of why Dependency Injection is not the same as Inversion of Control and you should not use the two terms inter-changeably. You can view the screencast below (you can use right most icon on the control to make the player full screen if you can't make out the code sample)


Video: IoC is not Dependency Injection

or download it from my Skydrive account using the link below.

Glasgow Grok Talks - Reminder

Just a reminder that I'm speaking at the Glasgow Grok Talks tonight (March 11th) on the subject of the Inversion of Control and Dependency Injection patterns.

IMTC 2008

I'm speaking at the Irish Microsoft Technology Conference 2008. The IMTC 2008, is an 8 track, 40 session extravaganza covering a breadth of Microsoft's latest emerging technologies. Throughout the festival there will be numerous networking opportunities, coffee and session re-runs. The agenda is available here.

I'm Speaking at Developer Day Scotland!

I've just been told that my proposal to talk about the Web Client Software Factory at Developer Day Scotland has been accepted, so I'll see you all on May 10th.

Respect Costs Nothing

My cousin's in the army and they send him to some to the loveliest parts of the world and you never hear him complain about the life he's chosen; today his wife sent me this video; 'nuff said really.

Respect cuz; just make sure you zig when they zag :-)

Technorati tags:

WCSF Oops!

If you've installed the February 2008 release of the Web Client Software Factory and, when building your first web app, you get an error similar to

"Cannot find System.Data.DataSetExtensions blah blah blah

then check the dll which is located at C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\; if it has a version of 3.5.20706.1 then you did what I did. You installed the WCSF on a machine which has the beta version of Visual Studio 2008 on it. You need to uninstall that version and load the release version of VS 2008 where the version number for the above dll is 3.5.21022.8; or at the very least you'll have to install the release version of the .Net 3.5 framework redistributable.

WCSF Update

The February 2008 release of the Web Client Software Factory now supports Visual Studio 2008. Get it whilst it's hot. Below you'll see a screen capture showing the dependencies you will need to load before installing this release.

WCSFDep

DDD Ireland Trailer

The guys who are organising DDD Ireland asked us speakers to put together a little trailer of the presentations that we are going to be giving. I've done mine and uploaded it to my Skydrive account; if you are interested you can watch it by clicking the link below.

Twitter Updates


    Follow me! :-)
    www.flickr.com
    GaryShort's photos More of GaryShort's photos