Monthly Archives: August 2010

Umbraco: How to get Media in code-behind

To get a media (i.e.: image)  in code-behind you can do it like this.

var currentPage = umbraco.presentation.nodeFactory.Node.GetCurrent();
var media = new umbraco.cms.businesslogic.media.Media(
            Convert.ToInt32(currentPage.GetProperty("[property]").Value)
    );
string imageUrl = media.getProperty("umbracoFile").Value.ToString();

Thoughts on Visual Studio LightSwitch

Earlier this month (August 2010) Microsoft has introduced a new Visual Studio family member, it’s Visual Studio LightSwitch.

Visual Studio LightSwitch is RAD (Rapid Application Development) tool that can be used to build WPF and Silverlight applications in an easy way.

Don’t expect me to explain the features in this post, it will be too long πŸ™‚ instead please watch the following videos:

Okay, done watching? πŸ™‚

This kind of tool is not new. Many 3rd party software companies has built similar tool and my favorite was Iron Speed Designer but the output is ASP.NET website rather than WPF or Silverlight.

Iron Speed Designer was great. I used that tool in 2007 to 2009 because it was the main dev tool at the company I used to work. But the downside is the cost. It’s too expensive to get the full features. For a single seat of Enterprise Edition it cost $3,975.

This Visual Studio LightSwitch is absolutely a great tool and it absolutely has good market prospect. It’s a very good decision from Microsoft to develop this tool.

I hope Microsoft can release this tool in an affordable price. If that will happen, I canΒ  say “Visual Studio LightSwitch is Iron Speed Designer KILLER”.

PS: The free public beta will be available on 23 August 2010.

VS2010 Tips #14: How change the default browser used in debugging ASP.NET MVC 2 application

Changing default browser used in debugging ASP.NET MVC 2 is a bit tricky in Visual Studio 2010. To use ScottGu’s steps, you will need to add new ASPX page first. But unfortunately if you delete the page then close the application, anytime you rerun the application then the change you did will lost (it backs to use the default browser set in OS).

In my case I have Firefox set as my default browser but I need to use Internet Explorer as default browser for debugging. The trick I do is by doing these:

  1. Open the project properties
  2. Go to Web tab
  3. Set the Start Action to use Start external program and then pass the Internet Explorer executable path and the url as Command line arguments.
  4. Set the Servers’ specific port to the same port set in the url in step 3.

image

(click to view the image in original size)

Make donation to this article: