An Example Single Page Application Site

Thoughts On An SPA Using Just C#/.Net

me in the garden

This part of the web site is a Single Page Application, apparently this is the Flavour Of The Month for web sites.

Being fair, I too prefer this style a lot of the time, but building SPAs and MPAs (multi page) sites is done quite differently.

Some details on the implementation are here, the important point is that it is not using a javascript framework.

An SPA Using Only C# and .Net

Normally SPAs are created using javascript libraries like React.
A detailed explanation on how this page works is available here.

Basically the idea is to implement each page as a C# class possibly in a dll that provides the mark-up that is dropped into an <asp:literal>

Invented Here is very out of fashion at the moment and whilst I don't think that most businesses need to copy Google and create Go or Facebook and create React, they also don't need to copy what they did, instead they should do what is right for their business.

When you have a big IT department it is quite easy to use various technologies and not have to worry about staff having the necessary skills or configuring servers.

With small departments the cost of extra languages and frameworks can be very high, training and familiarity take time, only Fred understands that and he is off this week so can you make do with what you have?

Because a lot of my background is with hardware makers writing code rather than looking for it on the internet is normal for me. Just writing what you need is often better and cheaper for your business in the long term.

Pop onto StackExchange and see how many people are saying something like I've spent two days on this problem, why doesn't it work and the answer is You need to set property Version="2021" even though you have 2022 because the dependency FredWhoHasLostInterest hasn't been updated and doesn't recognise 2022.

Or even worse the package WeirdButWeNeedIt is still supported and they have decided that iPhone x.x is no longer supported and that is critical to you.

You may think that I am being silly on this but I am surprised just now many sites don't work with an iPhone 5. I don't mean some state of the art feature, I mean something like a pop-up when you first visit the site which takes up the whole of the screen and you can't dismiss it or a menu that doesn't do anything.

Obviously if you retain control you can do most of your pages in the most productive way and then handle any special cases the best way for you; We're going to hand code that page, create some special Javascript and call a WCF service.

Of course there is limited benefit to the end user if the page could update with just 10ms of server CPU time but in the real world the response speed of the server is all over the place, if you look at this response to PING you can see quite a range.

Pinging [] with 32 bytes of data:
Reply from bytes=32 time=68ms TTL=114
Reply from bytes=32 time=75ms TTL=114
Reply from bytes=32 time=2382ms TTL=114
Reply from bytes=32 time=736ms TTL=114

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 68ms, Maximum = 2382ms, Average = 815ms


Other Interesting Pages On Some Of My Sites.
Car Insurance Premiums Explained
Generic car picture Car Insurance Premiums Explained This site aims to explain how car insurance premiums are usually calculated in response to repeated questions on various internet fora such as;

I added my mum as a driver and the premium went down.Why is someone quoting £300 and someone else £1200? Why is my renewal premium higher than my first year's premium?
Buy A Ghost
Picture of a cat with yellow star Buy A Ghost is a light hearted source of one page ghost stories aimed at pubs and restaurants as talking points.

Print them off and put them on the tables or walls and you have an instant talking point.

Aimed at regulars who have run out of things to say or new groups or couples as an ice-breaker.
Weight Loss Calculator
Screen shot of weight loss calculator Weight Loss Calculator Tries to simulate the body and report the effects of food and exercise in periods as short as 15 minutes.

This level of detail highlights the effects of a run, bike ride or chocolate bar.

For those who are new to exercise, weight fluctuation due to glycogen usage is made much clearer.
Please note that these links do not use any tracking cookies or similar technology.