Showing posts with label web design. Show all posts
Showing posts with label web design. Show all posts

18.3.14

Checkboxlist no values

Can't compare values in a checkboxlist to those from a datasource / datatable?

Make sure the checkboxlist listitems actually have values first. They won't have values on page load - you might need to run your compare script under the DataBound event instead...

HTML:

<asp:CheckBoxList runat="server" ID="interest" OnDataBound="interest_databound" DataSourceID="dsInterest" DataTextField="InterestDescription" DataValueField="InterestID">
</asp:CheckBoxList>

Code-behind:

protected void interest_databound(object sender, EventArgs e) {
   int PersonID = 5;
   SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["db"].ConnectionString);
   SqlCommand cmd = new SqlCommand("SELECT PersonID, InterestID, InterestDescription FROM Table where PersonID = '" + PersonID + "'", con);
   con.Open();
   SqlDataReader dr = cmd.ExecuteReader();
   while (dr.Read()) {
      ListItem currentCheckBox = interest.Items.FindByValue(dr["InterestID"].ToString());
      if (currentCheckBox != null) {
         currentCheckBox.Selected = true;
      }
   }
   dr.Dispose();
   con.Dispose();
   cmd.Dispose();
}

4.2.10

DataFormatString list

Why in the name of cock is it so hard to find a decent list of DataFormatString values for BoundField properties? I'm sticking this here so that I have something to refer to, and can add to it in future if I find more stuff.

So, for DataFormatString="{0:whatever}", whatever can be any of the following:

Numbers

c - currency £#.##
d - decimal ##.##
e - string of e+###
f - string ##.##
g - fixed point or scientific notation
n - #,###.##
p - percent
x - hex

DateTime
d - short date
D - long date
t - short time
T - long time
f - full datetime and short time
F - full datetime and long time
g - short date and short time
G - long date and long time
m - month

edit - loads more here at msdn

edit 2 - holycrap, found loads now.

standard numeric
custom numeric
standard date
custom date
enumeration

27.10.09

The closure of Geocities

Earlier this week, Yahoo closed Geocities.

Geocities was a free website hosting company, launched in 1995. The servers comprised of virtual neighbourhoods and blocks, where pretty much anyone could have their own website. If your website was music based, your neighbourhood would be sunsetstrip. Sci-fi sites went into Area51. You then had your own block under there ie www.geocities.com/sunsetstrip/3635 (sunsetstrip ftw).

Most geocities websites comprised of bright text, centred over a dark background, with transparent tables, animated gifs, marquee tags and horrible MIDI tracks. My first site was on geocities! It was horrible, ugly as fuck, and as a full time web developer I'm embarrassed by it. But that doesn't stop the closure of Geocities being a terrible idea.

So what if there was a lot of rubbish on there? There was also a lot of useful information and a lot of memories, too. How many old tech manuals were on there? How many broken links have Yahoo created by removing Geocities? How many Geocities websites were created by people who have since died?

It's a piece of history, and a reflection of the state of the Internet at that time. Yahoo should at least have made a proper backup or snapshot of the site, but all they did was point archive.org in the right direction and say "get on with it".

As Jason Scott puts it: "Help me save Geocities. Not because we love it. We hate it. But if you only save the things you love, your archive is a very poor reflection indeed."

More awesome Jason Scott speak here.

18.3.09

Project Darwin

Yesterday Jonathan (@fatherjack) and I began a new project that we saw fit to name Darwin. In the style of Call My Bluff, let's see if you can guess what it's about...

Option A)

Project Darwin is our experiment to prove Darwin's theory of evolution. We shall place nineteen labrador puppies in a cage, and suspend food from the ceiling, about 2 foot out of range of the tallest puppy. We predict that, over the course of several thousand years, the puppies will grow extra long necks in order to reach the food - much like the giraffe, the ocelot, or the subterranean cloudbeaver.

Option B)

Project Darwin is a web development project, which had a commencement date of March 17th 2009 - St Patrick's Day. One of the more popular beverages on St Patrick's Day is Guinness, so the name Darwin was inspired by their NoitulovE advert.

Option C)

Darwin is an anagram of Rad Win. We're going to enter and win the 2010 Xtreme games, thus performing a "Rad Win". We shall defeat our competition (such as expert fireworks skateboarder Tony Fawkes, or 7 time drillskating world champion Chip Fuckstock) by shooting them before the games begin.

Answers on a postcard please, to:


CLICK REPLY YOU BASTARDS,
CLICK REPLY,
CLICK IT,
SEE THAT REPLY BUTTON RIGHT THERE?
CLICK IT, BASTARDFACE.
London SW1 CLICKREPLYZOMG

4.12.08

Opera 10 is out


Opera 10 is out and I've decided to take it for a test drive on the Acid3 track. I was surprised (and chuffed) to see it score 100/100!

In comparison, Firefox 3.0.4 scored respectable 71/100, and Internet Explorer 7 choked on its own shit and died.

16.9.08

Dear Microsoft,

Thank you so much for the easy server upgrade from .Net 2 to .Net 3.5. Also, thank you for deciding to NOT show v3.5 in the ASP.NET IIS tab, prompting me to panic over the apparent installation failure. Thanks also for NOT explaining that 3.5 won't show up in the tab.

Please send a cheque for approx £35, so that I can buy new trousers.

Sincerely,

Foss

9.8.08

Web designers

Cameron Moll is an amazing web designer, and I've been a fan for a long time.

Dale Harney, however, is a thieving piece of shit.

11.7.08

A rare serious post - web standards curriculum

I read about Opera's Web Standards Curriculum yesterday, and have gone into a bit more depth this morning.

I have to say this:

If you are thinking about getting into web design, start with the web standards curriculum.

Seriously. It's amazing. It's like everything I've ever learned about web standards, and more, all in one place! What "web standards" are, why we should use them, information architecture, search engine optimisation, accessibility... It's all there!

9.4.08

More on twitter

Loads of fuckers have been using twitter for ages and now I'm just starting to get into it. It's basically a mini-blog, the status bit from facebook and a simple facebook wall all combined into one. Using Twitbin, I can post directly to twitter from firefox, and I've also added my twitter RSS feed to ze sidebar of this 'ere blog.

18.12.07

Please, santa (or whoever)?

I'll love you forever if you buy me this for christmas. KTHX.

24.9.07

Ze future!

Well, it's official, I'm starting my own company! I'm keeping my full time job to keep the steady income, but I'll be putting in extra hours in the evening and weekend, building up my own web design business. Here's to me being my own boss! Woot!