My latest project at work is a bit confidential, but I can say that it has me designing a webpage. I grew up on this stuff and I’ve almost entirely self-taught myself it. This time, I was given the design prototype, and didn’t have to worry about the actual design of the document.

But it was still a huge bitch. I began by reading up on some extra CSS articles. Maybe this time I’ll try absolute positioning instead of floating divs. It has its own issues. Creating web pages is fun for me … up until I run into the issues. I seems the W3C specs aren’t designed to make things easy for web designers. Some of the most common practices in web design are using CSS specs that aren’t designed specifically for layouts. Absolute positioning is generic – it’s useful for positioning arbitrary elements, which has a lot of use in layout design, but it has limitations and problems. Using floating divs and wrappers and margins to create a particular layout is using these tools for something other than what they are design for.

Take float – it’s a property to make text flow around an object. It wasn’t designed to create columns on a webpage. And there’s no CSS property that creates columns, or a header. In simple cases and the beginnings of large projects, working with a web layout seems simpler than a desktop application layout. All you need are some elements and style rules – no worry about creating objects and adding them and listening for events.

But I’m beginning to wish we had a better approach to creating webpage layouts. Something that’s actually designed to create web forms and two-column pages. The SWING library for Java is a good example. It was designed to create layouts for people to use an application. CSS is designed to style documents. It does have its uses, and that is styling documents. But there are a lot of cases where that doesn’t apply. I would guess that the majority of uses of CSS are either web applications or websites (with columns, headings, footers, and the whole bit) I have no clue what the actual distribution is, or if even the majority of cases are that way, actually, but you can’t argue that there’s a lot of cases like that. And CSS simply doesn’t lend itself well to that.

I’m not saying to abolish CSS. It needs to be improved though, perhaps split into separate specifications. Give me something where I can layout a page as easily and reliably as I could with a table, without the actual horrible atrocities of table design. I’d like something where I can say “this element is going to be a left column that spans from below the header to the bottom of the document” and “the element is going to be a horizontal menu whose items are centered and spaced evenly”. I’m sure some would say that was too specific. Rules that would be used to do that simply would be very narrow-focused. But there are so many cases where this could be used.

CSS is about separating the content from the design. But we should be able to separate parts of a CSS document: style and layout. Fonts, colours, paragraph spacing, etc, are all design properties. Floating divs and absolutely positioned footers are all things that make up a layout. I haven’t looked into to HTML5 much, so maybe there’s a step in the right direction, but what about something like this?

<html>
<head>
	<title>FGC Sample</title>
	<style>
		page {
			width: 800px;
			horizontal-position: center;
		}

		header {
			width: page-width;
			height: 100px;
			color: white;
			background-color: black;
		}

		navigation {
			nav-style: horizontal;
			item-spacing: equal;
			item-position: center;
			background-color: blue;
		}

		item {
			color: white;
		}

		item:hover {
			font-weight: bold;
			background-color: green;
		}

		content#aside {
			type: column;
			top: auto;
			bottom: document-bottom;
			width: 300px;
			position: left;
		}

		content#aside h1 {
			text-transform: uppercase;
		}

		content#main {
			type: column;
			width: auto;
			position: center;
			height: auto;

			color: black;
			background-color: blue;
		}

		content#main #execphoto {
			float: left;
			margin: 5px;
		}

		footer {
			width: page-width;
			font-size: 0.8em;
			font-style: italic;
			color: grey;
			background-colour: black;
		}
	</style>
</head>
<body>
	<page>
		<header><img src="header.png" /></header>
		<navigation>
			<item href="#">Home</item>
			<item href="#">Products</item>
			<item href="#">About</item>
			<item href="#">Contact</item>
		</navigation>
		<content id="aside">
			<h1>New product launched!</h1>
			<p>We have launched a new product XXBBYY</p>
			<p>Herp derp derp</p>
			<p>FARBLE GARBLE FBRARFGARFGB</p>
		</content>
		<content id="main">
			<h1>Welcome to FarbleGarb CO</h1>
			<img id="execphoto" src="mrfarble.png" />
			<p>At FGC we have pride and garbs to make you garble in pride.</p>
			<p>These paragraphs will float around that image like in regular CSS</p>
		</content>
		<footer>Copyright &copy; FarbleGarb 2009</footer>
	</page>
</body>
</html>

I don’t even have to tell you what it would look like, really, because the CSS explains it. Not perfectly, perhaps, but that’s why I’m not working with the W3C to design the next specs. I’m not even that great of a web designer. But I do know what problems I run into when I’m working on a website, and all the articles across the web that take a genius to get a properly flowing 3-column layout with variable length columns and a footer.

I doubt there’s going to be anything like this soon, or even not soon. CSS3 is barely implemented, and IE still has troubles with most of CSS2 and some of CSS1. But I can dream (and rant), right? One day I’m going back to party like its ‘99 and make a table-based layout. Yes, <font> tags and all.

(I’m extremely interested in other folk’s opinions. I know there are a lot better web designers out there, and I know they don’t read this blog. But if there’s any post that I think deserves commentary and discussion, it’s this one.)

, , , ,

I recently had an issue where I converted some User Controls to code-behind model, and moved them to another directory. I then found I couldn’t reference them in code. After a post on the ASP.NET forums, I came to a solution, and devised the rules as to how you can reference a User Control in code:

  1. The control needs to have a ClassName tag in the <%@ Control %> tag (actually, I think if it doesn’t you’ll use the generated class name?)
  2. The page has to use a <%@ Reference %> tag in the .aspx file to reference the control
  3. If page uses a code-behind file, the namespace “ASP” contains all controls reference with the <%@ Reference %> tag. If it’s inline code, there’s no need for this.

If your page is inline code, you don’t have to worry about the ASP namespace. The ASP namespace is a dynamic namespace that contains the controls you referenced with the <%@ Reference %> tag in the markup file.

I hope this helps anyone having problems referencing User Controls by classname in their code. I searched for quite a while and I only got answers like “don’t use code-behind if you want to do that” or “have all your controls implement a Interface and reference them by that interface”.

Please post any comments or questions. I check my email/comments daily, so a response should be pretty quick (usually about 1 business day maximum. If I’m at a computer working, I usually respond right away). You can also contact me by email.

, ,

Earlier I posted a “solution” to a problem where I couldn’t export. I searched high and low, running through DLLs and assembly references. I thought I had it working by changing the DLL of one assembly reference the to version 10 reference (CR 2008 is version 12). I stopped the post there. Later, I realized the different assemblies were pretty integrated with each other, and you couldn’t just have different versions floating around (DUH). So I changed them all back to version 10.

Of course I still had issues with that. I forget what, but it wasn’t good. I think it wouldn’t run on the production server. That server doesn’t have Visual Studio installed, only the CR engine. The version 10 assemblies I were using were the Crystal Report packages that came with VS.NET 2008.

In order to successfully be able to use all the correct assemblies, I had to do more research. What I ended up doing was completely uninstalling Crystal Reports and reinstalling it, and configuring some Virtual Diretories. The steps and and explanation after the jump.

Read the rest of this entry

, , , , , , ,