Tuesday, 9 June 2009

CSS Sticky Footer in ASP.NET

One of the features that almost every web page in a RIA needs is a footer, this is not from a predefined RIA template but from observations of sites which already exist.

Trying to create a web page which pushes down content to form the footer at the bottom of the page without fail, regardless of content and browser window size can be tricky however there is one solution which sticks out, the CSSStickyFooter solution.  The CSSStickyFooter site contains the CSS which is used to apply the style and details on how you need to construct your HTML to take advantage of this.

I am overjoyed by the solution and I am really enjoying the ability to have a footer which sticks to the bottom of my page, however as an ASP.NET developer I was almost disappointed when I found that the CSS did not work for ASP.NET pages until I realised the solution.

Open your sticky footer CSS file and make the following changes;


html, body, #wrap {height: 100%;}


html, body, form, #wrap {height: 100%;}

As you can see the form tag has now been added to the list of elements which gain a 100% sizing, all ASP.NET pages are wrapped in a form element.

Finally change;

body > #wrap {height: auto; min-height: 100%;}


form > #wrap {height: auto; min-height: 100%;}

As the form element wraps our content we need to specifically select the #wrap element, child of form (not body) and apply the styling to make the sticky footer work.

I hope this has help fix the small issues in getting this to work in ASP.NET pages.

Thursday, 7 May 2009

ASP.NET Core Tips

There is so much to .NET it hard to know what to keep it in your brain and to know what to let go, its sometimes such an issue for me I end up replacing everyday memories with those of .NET. As soon as I can remember how to walk instead of creating generic types I will move away from this computer!

A good way of keep your brain free is to use reference cards, and even though these tend to be on the simple side we can all do with a little pointer now-and-again.  The guys over at RefCardz have seen this need and produced a free core ASP.NET reference card to download now.

The only downside is you have to print it, but never mind.

More info @ http://refcardz.dzone.com/refcardz/core-aspnet

DDD South West Agenda

For all of you who are attending DDD South West on 23rd May 2009, the agenda has just been released and its a fine piece of work.

You will find topics on Silverlight, XNA, AZURE, MVC and many more so go to www.dddsouthwest.com and have a look at the agenda and start planning your day.

What is DDD South West?

DDD South West is a free one day technical event for developers. It is a day of learning, discussing, contributing and being part of the community in the South West. Our goal is to provide free technical education, the opportunity to mix with peers and to make and develop relationships in the .NET industry.

By The Community, For The Community


Tuesday, 5 May 2009

IE8 Competition

The IE8 team are running a little competition, and in Mike Ormond’s own words “Fame and Fortune await for those who play with IE8”.

You can find the official terms and conditions here, but a brief synopsis on what’s required....

All you have to do is create an original accelerator, web slice or visual search provider for Internet Explorer 8. They’re incredibly easy to write and within no time at all you could have produced a winning entry. There are lots of resources available to help you on your way:

The criteria on which entries will be judged (eg innovative use of technology) are included in the terms and conditions.

The prize is for a brand spanking new Xbox360 elite no less!

For further details on how to enter, please visit Mike Ormond’s blog where you can find a whole lot more information


The competition is open to all. The closing date is the Friday 29th May 2009.

Thursday, 9 April 2009

DDD South West – Vote for your favourite session

The sessions for DDD South West have already been selected but we need your votes to help us to select the best rooms for the sessions to try to ensure that the most popular sessions can be seen by all.

To vote for your favourites click here.

Remember DDD South West is happening Saturday 23rd May, if you have not registered yet there are still some spaces left but do not leave it too long to avoid disappointment.  Remember there can be only one first time.

Hope to see you there.


Tuesday, 3 March 2009

DDD South West Registration Is Open!

Go! Quickly! Stop reading this and register now! Registration for DDD South West is now open. Be able to tell your grandchildren that you were there at the very beginning. Remember, there can be only one first time.

DDD South West is a free one day technical event on Saturday 23rd May 2009 at Queens College, Taunton with 13 top speakers providing 19 technical presentations.

Code Contract For .NET

Developing a framework can be hard as there is alot to think about, like a user interface you need to think of the different ways it may be used and only expose those methods which make sense to be called and because most people will never read you documentation (and why should they) you make sure that each public method is named correctly. 

As we all know those framework methods form a contracts between you and the consumer as to how the framework will be used, the consumer is obliged to supply certain details and the framework is required to return certain details.

I find creating frameworks interesting, this is mainly because I have never been a great interface designer, and I also find it easier as there are a finite set of rules for how to create them, all around me in .NET I can just emulate the same structure (I see how Microsoft have done it and I copy it).

Even though the creation of frameworks removes the need to understand how to lay text boxed on a web page or form you still need to do almost as much validation, you need to make sure that the values supplied to the methods are correct, when the are not you need to throw exceptions which can be caught or the alternative is you do not worry what is supplied, but surly no one does that! 

This is how we currently validate the input and sometimes the output of our framework methods and we just hope that the code calling us also validates our data.

Like all issues us developers have come across and found a way to deal with a small team in Microsoft have said ‘we can do better’ and when it comes to the issue of method contracts (validation of data in and out) they have done exactly that with the creation of the ‘Code Contracts for .NET’.

The code contracts framework is implemented through static classes which can define pre and post conditions for any method call, you own, and once implemented the compiler will come into play to warn you of code which breaks these conditions and at runtime the exception handling processes do the same.

For me to repeat the exact details of how this work and how to implement it would be foolish so to read a better explanation by Soma (Corporate VP of Microsoft''s Developer Division) go to his blog.

Or watch the Chanel 9 video here

Thursday, 26 February 2009

The .NET Developer Network – March 2009

When: Monday 9th March 2009, doors open 6:00pm, meeting starts 6:30pm

Where: UWE (University of the West of England), Frenchay, Bristol (see FAQ for directions and a map) - Room 2q49 (in Q block)

What: Windows Azure And SQL Data Services (SDS)

Who: Eric Nelson, Microsoft Developer Evangelist.

Why: Because Eric is Captain Database. It's what he does and he's very good at it. Also because SQL Data Services offers a world of potential that may be a life saver to your applications. Also also because Eric is very easy to listen to and he lives up to the very high bar set by all Microsoft UK Developer Evangelists.

How do I sign up for this meeting: Send an email to meetings at dotnetdevnet.com and quote your user name and the March meeting.

The Azure™ Services Platform is an internet-scale cloud computing and services platform hosted in Microsoft data centers. The Azure Services Platform provides a range of functionality to build applications that span from consumer web to enterprise scenarios and includes a cloud operating system (Windows Azure) and a set of developer services, including SQL Data Services (SDS).  Both Windows Azure and SQL Data Services provide data storage capabilities, the latter offering highly scalable and Internet-facing distributed database services in the cloud for storing and processing relational queries built on robust SQL Server technologies. This session will introduce the Azure Service Platform, discuss how to take advantage of it in your own applications and drill into the two storage options.


After many years of developing on UNIX/RDBMS (and being able to get mortgages) Eric joined Microsoft in 1996 as a Technical Evangelist (and stopped being able to get mortgages due to his new 'unusual job title' in the words of his bank manager). He has spent most of his time working with ISVs to help them architect solutions which make use of the latest Microsoft technologies - from the beta of ASP 1.0 through to ASP.NET, from MTS to WCF/WF and from the beta of SQL Server 6.5 through to SQL Server 2008. Along the way he has met lots of smart and fun developers - and been completely stumped by many of their questions! In July 2008 he switched role from an Application Architect to a Developer Evangelist in the Developer and Platform Group. Currently Eric’s interests include digging into LINQ to Entities, ADO.NET Data Services and switching from C# to Visual Basic development. At home, he battles rat infestations, comes second to the family dog and uses any spare moments he has after 10pm to team up and play online with and against friends - keep an eye out for 'erknel' and say 'hi'.

Thursday, 19 February 2009

Bespin From Mozilla Labs

At the moment everything is moving into the cloud and I am still having a hard time seeing how this will all work or why I would do such a thing especially since I have spent so many years keeping everything firmly on the ground. 

Recently I came across a project called Bespin developed by the Moxilla guys, the same group of people who gave birth to FireFox, the aim of the project is to take application development into the cloud at first I was sceptical thinking of all those nasty HTML editors you get on some web sites but once I looked at their interface it was quickly apparent that this was the kind of IDE I would expect from a desktop application;


The aim of the project is not only to allow you to develop applications in the cloud but to also use the openness of the web to increase collaboration through an amazing process of collaborative desktops in the web browser!!

I have not had chance to use this new web application but have a look at their video on the home page and I think you will agree that these guys are doing some very interesting things with you web browser.

To see the detailed information go to http://labs.mozilla.com/2009/02/introducing-bespin/

Tuesday, 27 January 2009

DDD South West – Saturday 23rd May 2009

Are you a .NET Developer in the South West of the UK?

Do you want to attend a FREE one day event, covering all that is new and great in .NET?

The DeveloperDeveloperDeveloper (DDD) South West meeting is where you need to be, this event is held on a Saturday so you do not need to worry about taking time from your busy work schedule to attend.  For those of you who know the DDD events, which happen in Reading yearly, this event will follow the same high standards for speakers and topics covered. 

As we are aware that the South West has lacked this kind of event for a very long time we will be holding the event in Taunton at the Queens College.

The exact agenda for the day is still being finalised but rest assured as soon as it is you will know well in advance, to show you how we have organised ourselves our timeline for the run up to the meeting is as follows;

  • Tuesday 27th January - Website goes public, Call For New Speakers opens
  • Tuesday 3rd March - Registration goes live
  • Tuesday 31st March - Call For New Speakers closes
  • Tuesday 7th April - Vote for favourite sessions opens
  • Thursday 30th April - Vote for favourite sessions closes
  • Saturday 23rd May – DDD South West

To stay in touch with the latest news about the event or find more information about the venue and the team running it please visit the official website @ http://www.dddsouthwest.com

Tuesday, 13 January 2009

Web Client Software Factory (WCSF) Event Broker

To get the EventBroker to work with version 2.0 of the Web Client Software Factory read this blog.

Although the code change in the above blog entry allows the Event Broker to work you may still come across some problems, the one I recently encountered was related to generic method overloads.

Before generics you could not overload a method without changing its signature, but with generics you can alter the method signature with a type T return for example;

string Get(sting value1)

overload to;

T Get<T>(sting value1)

Now to the compiler the two methods are different, however when you use reflection to find methods and you use the Type.GetMethod, supplying the method name ‘Get’ with the correct types you will receive a ‘System.Reflection.AmbiguousMatchException’ exception. You receive this exception because to find the generic method you supply ‘Get’ and not ‘Get<T>’ which is also how you return the non-generic ‘Get’ method.

Due to the issue above when the Event Broker runs its sanity check by reflecting all your method the ‘System.Reflection.AmbiguousMatchException’ exception is raised when you have a generic overload to overcome this replace;

EventBrokerSanityCheck.cs, ln 147

interfaceInfo = @interface.GetMethod(subscribingMethodInfo.Name, types.ToArray());


MethodInfo interfaceInfo=null;
    interfaceInfo = @interface.GetMethod(subscribingMethodInfo.Name, types.ToArray());
catch (System.Reflection.AmbiguousMatchException)
    //Bug fix for generic overloads
    interfaceInfo = @interface.GetMethods().Where(w =>
            w.Name == subscribingMethodInfo.Name
            && w.IsGenericMethod == subscribingMethodInfo.IsGenericMethod).First<MethodInfo>();

    ParameterInfo[] parametersInterface = interfaceInfo.GetParameters();

    if (types.ToArray().Length == parametersInterface.Length)
        for (int i = 0; i < parameters.Length; i++)
            if (parametersInterface[i].ParameterType != types[i])
                interfaceInfo = null; //clear the interface info as we did not find the method
        interfaceInfo = null; //clear the interface info as we did not find the method

[Disclamer : I give no warranty to the correctness of this solution or that there is not a better way to do it, I just hope I help you out of a hole as it did with me]

Tuesday, 6 January 2009

Patterns & Practices - Pocket Guides

The Patterns & Practices team at Microsoft spend their time looking at the best methodologies to design and build software and as part of this they produce many frameworks to build software with and guidance documents which outline their proposed best approaches to designing certain software.

Some of these guidance documents have been made available in pdf format covering the following architecture topics;

  • Web Applications
  • RIA Clients
  • Services

Each guide gives practical guidance on what you need to consider when creating software for each environment, these should be your first stop when stating the creation of your software.

To download each guide go here