Jeroen's corner

ASP.NET button does not work inside JQuery UI Dialog – solution

If you place controls inside a JQuery UI Dialog you quickly come to the conclusion that the postback event isn’t triggered anymore. That annoyed the hell out of me, as there was a GridView control on it as well and I needed the data in it. So an alternative ajax call wouldn’t do the trick for me.

So, what is the solution?

Read more

Multi Column Listbox (Jquery)

Ever needed a multi column listbox? I did!

I developed a multi column listbox that reacts just like a regular listbox, with Shift and Ctrl selection methods. The items for the listbox can be provided as an array or as a comma separated string. The height of the listbox is configurable by setting the number of items per column.

A demo can be found here.

Reactions and improvements or improvement proposals are more than welcome.

Someone else’s code…

I know, it’s always easy to burn someone else’s code to the ground. But what was the developer thinking when he came up with the code below?

string[] fieldToSplit = xmlElement["fieldtosplit"].InnerText.Split('-');
int passes = 0;
foreach (string fieldPart in fieldToSplit)
{
    if (passes == 0)
    {
        someObject.FirstPart = fieldToSplit[0].Trim();
    }
    else if (passes == 1)
    {
        someObject.SecondPart = fieldToSplit[1].Trim();
    }
    passes++;
}

Take special interest in the variabele ‘fieldPart’ that is used to loop through the array. It isn’t even used. Weird!

He could have done the exact same with:

string[] fieldToSplit = xmlElement["fieldtosplit"].InnerText.Split('-');
someObject.FirstPart = fieldToSplit[0].Trim();
someObject.SecondPart = fieldToSplit[1].Trim();

Oh well… I was already working on a clean up action anyway.

Lekker dagje sauna…

Een tijd geleden kwam Cindy volledig in jubelstemming naar beneden gelopen: “Ik heb een sauna-arrangement van De Zwaluwhoeve gewonnen op vakantieveilingen.nl.” Uiteraard sloeg het woord ‘gewonnen’ alleen op het feit dat ze de bieding gewonnen had en dat we er dus nog steeds een redelijk bedrag voor neer moesten tellen, maar dat mocht de pret niet drukken. We gaan allebei graag naar de sauna, dus het zou ongetwijfeld een leuke dag worden. Omdat het erg druk was met reserveringen vond dit uitje uiteindelijk afgelopen zaterdag pas plaats.

Read more

Scroll To Top