August 2009 Entries

Is page in Edit mode

Posted Monday, August 31, 2009 2:40 PM | Feedback (2), Filed Under .NET C# developement EPiServer

I’m writing an account registering control. This control needs to show the user how to register for a new account. But when modifying this control the pages editors must be able to see the hole flow. So I went looking for a smart way to display the control in two ways depending on the context it’s being viewed in. I found Jacob Khan’s blog post in EPiServer labs that seemed nice but I didn’t get it to work.

The thing I ended doing was to get the id from the query string, and parsing it to a PageReference to check if it contains a workID. The ID in the QueryString has both the pages ID and the current version being edited, for example 1563_1234 where 1563 is the pages ID and 1234 is the current version.

If the QueryString contains a work page ID it means that I'm currently looking at a draft, not the published page, hence I´m in Edit mode.

When getting the WorkID of a PageData object that's published you will get 0 as a result, and that's what I'm testing against.

Here is the code

public bool IsPageInEditMode
{
    get
    {
        PageReference pageVersionReference = PageReference.Parse(Request.QueryString["id"]);
        if (pageVersionReference.WorkID > 0)
            return true;
        return false;
    }
}
Technorati-taggar: ,

Windows 7 round 2

Posted Wednesday, August 12, 2009 9:33 PM | Feedback (1), Filed Under Windows 7

Well after not being able to find a fix for the bug/feature that made Visual Studio 2008 hang when I attached to the w3wp process, I decided to do a clean install. After all every one else in the company didn’t have this problem. I suppose that there where some drivers left from my upgrade from Vista that didn’t quite match.

Now I’m actually just loving the smooth ride with Windows 7. I think this is going to be the new XP but without the nasty bugs that haunted us at the beginning. I wonder if Windows 7 will last until 2017.

Windows 7 installed now what?

Posted Friday, August 07, 2009 12:17 PM | Feedback (0),

This morning I finally got to install the new Windows 7 RTM. I did an upgrade from Vista Business to Windows 7 Enterprise and I can tell you that it was a really pleasant experience, the only thing I had to do was to click the obligatory EULA agreement, then every thing was set.

Everything went smoothly, mail, VPN and Visual studio started just fine. The backlash came when I was going to attach the debugger in VSTS 2008 to the w3wp process. I could say that all hell broke loose. The hole IDE was totally unresponsive, although the Task Manager told me that Visual Studio was running nicely, I could do nothing but kill the process.

So here I am, in the middle of the night tearing my hair looking for answers, of course being just a day after the RTM release it’s kind a hard to find people with the same problem.

AttachProcess

Repeated logon prompt in Vista

Posted Wednesday, August 05, 2009 11:48 PM | Feedback (1), Filed Under Vista

A colleague had a slight malfunction with her laptop this morning. After booting up the pc the “Ctrl + Alt + Del” login prompt appeared, not the usual login screen. She didn’t think too much about that, typed in her password and waited for Vista too boot up. She kept waiting and after a minute or so the same logon prompt showed up.

After three ours of rebooting, testing logins, goggling and troubleshooting we found out that the user profile somehow had been corrupted, hence windows was unable too logon.

The solution to this mess was to login in Safe Mode, change the name of the user profile folder (C:\Users\UserName) to (C:\Users\UserNameOld), and then reboot.

This will help because the next time windows tries to get the user profile files it won’t find it and creates a new one. Of course you will loose all your settings but they are still there in the UserNameOld catalog so you will be able to retrieve them later.