Archive for the ‘Programming’ Category

Oh the ways you can set selected on a dropdownlist!

Tuesday, February 9th, 2010

I recently ran into this problem that seemed really odd. This is the .net world and I am using an item template. On itemdatabound I set a drop downlist’s selected item like this:

somedropdownlist.Items.FindByText("someText").Selected = True

I thought this should have worked. It did not. When the control was rendered the item I choose was not selected. So I thought that this could be a life-cycle thing. I tried:

somedropdownlist.SelectedValue = "Some Value"

that worked. Why? I don’t get it.

Solving ASP.NET Compiler Issues with Unrecognized VB.NET 3.5 Feature Syntax

Wednesday, August 19th, 2009

The Issue

I recently encountered an issue with an ASP.NET 3.5 solution after converting it from ASP.NET 2.0.  The issue I’m going to be describing only pertains to the older web site projects (and only web projects — class libraries, etc. do not have this problem) as opposed to the newer web application projects.  I believe this to be true because the conversion wizard built into Visual Studio has rarely ever had trouble converting web application projects, while I’ve never successfully been able to automatically convert a web site project. (more…)

A Mini Tutorial on Regular Expressions

Tuesday, August 18th, 2009

I thought I share this mini tutorial I put together on RegEx.  It is meant to get you started under 5 minutes.  hope you find it useful.

Rugular Expression (RegEx for short) is a way of specifying a certain amount of textual data.  For example, “^X” means “a line that starts with the letter X”.

The simplest regular expression is the literal expression.  The expression “Where are you?” matches the test “Where are you?”.  Any literal, letter or digit, will match itself with few exceptions that we will talk about below.  There is a certain set of literals that have special purpose in RegEx and  it is those literals that give RegEx its power.  These literals are called meta-characters. (more…)