Sunday 30 August 2009

Making a Website with ASP.NET and HTML

Microsoft provides Visual Web Developer Express as a free download to design websites built on their .NET technology. .NET is nothing more than a common set of functions for interacting with a user and ASP.NET implements it for the Web via Microsoft’s Active Server Pages (ASP). These create the HTML from which a browser, like Internet Explorer, builds a Web page.

OK, that's the jargon. The bottom line is: you can cut all that crap and just use Visual Web Developer (VWD) as an HTML editor. It does some of the tedious typing for you by filling in text it knows you'll need and even makes it XHTML-compliant. And if you want to try any of the fancy stuff in .NET, like master pages and reusable code, it’s there for you.

I've already hinted at using this to design a website and the resulting mish-mash appears at my birding/writing/programming pages. Yes, it looks like I’m not going down the Drupal route: I’m the sort of control freak that likes to programme as close to bare metal (or silicon) as possible.

And really, VWD is simple, for simple pages. It’s only when you start pushing the technology that the learning curve becomes as vertical as the brick wall against which you feel you're banging your head. You have to try the whistles and bells one at a time.

Most frustrating recently has been CSS (Cascading Style Sheets). This is supposed to be the XHTML way to go: it separates style from content, presentation from the actual words. However, something as simple as centring images seems to require such an inversion of the thought processes that Einstein would struggle with it. This is not VWD’s fault: it merely conforms to the coming standards.

It did have one big roadblock when testing the website locally, which might drive the less tenacious away. So, here it is, cleared: Internet Explorer cannot display the webpage.

PS. I would never advocate not using the <p> element to mark up an HTML paragraph. After all, a paragraph is a paragraph, right? But look in your newspaper. Is there a space between paragraphs? Check the latest, or any, Harry Potter. Spaces there? The Bible? Goddammit, even an HTML reference book? Spaces between paragraphs? No.

Then along comes HTML itself. “I know: let's stick a space in between paragraphs.” Fucking brilliant, mate. So, here's a nasty, but CSS-compliant, way to remove the space and indent the way it used to be:
p {text-indent:1.2em; margin-top:-1em;}
p.scene {text-indent:0em; margin-top:0em;}

Now just add class=”scene” to the first paragraph of each piece. Scrivens!

No comments:

Post a Comment

 
Creative Commons License

This work by Andy Gibb is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England & Wales License. It also uses Google Analytics and so creates tracking cookies and collects non-identifiable data about you.