Archive for July, 2009

C# Wait for all threads completed with timeout

By admin - Last updated: Friday, July 31, 2009

We only want to do something after all threads finish their work. The advantage is that all the threads can work simultaneously while each of them has no dependency to the other. Typically, I found it improves efficiency when making call to the remove webservice. For example, there is a web service operation called getProductById(int [...]

XML deserialization, XML undefined property becomes an empty list

By admin - Last updated: Wednesday, July 29, 2009

When deserialize XML into object, the object’s property becomes an empty list even if the property is absence from the XML, the expected behavior is the property is null. For example, given a class public class MyFoo     {         public string Id { get; set; }         [...]

ASP.NET MVC POST HTML rich text data to the server incompletely.

By admin - Last updated: Sunday, July 5, 2009

Sometimes, when using javascript or JQuery to perform manual POST rich html content to the server, the server could misunderstood the parameters and the data passing in. For example, if you want to POST parameterised data. title=mytitle&content=helloworld=firsttest As you might notice helloworld=firsttest is actually user data, but by just posting the data above, the server [...]