While working on a new ASP.NET MVC project, I had a simple objective: add a new record and refresh my View. After sifting through several sites I found several resources that lead me to accomplish my goal. I’ve compiled my result into a new sample MVC Application that I created in Visual Studio that you [...]
Posts Tagged ‘.NET’
Using .NET 3.5 List.Distinct()
28 Apr , 2010
When I was working on a project today, I had a List of objects where I needed to grab objects that had a distinct property value (i.e. where MyObject.MyID is distinct).
I discovered the Distinct() method on the List and I had never used it before so I wasn’t sure of the syntax. After further review, I learned you can use the IEqualityComparer interface to specify how to determine if the object is distinct.
Using .NET 3.5 and Reflection to help with sorting a List
1 Apr , 2010
The other day I was looking to be able to sort a list of products (List<Product>). I was binding that list to a ListView and the client wanted to be able to sort the Products by Name (Z-A & A-Z) and by Price (Low-High and High-Low). I initially had something like this: public class SortProductsByPrice [...]
Updating a .NET Page in Real-Time Using jQuery and AJAX
29 Oct , 2009
Here’s a problem I bet you’ve run into before. You have a long-running function on one of your .NET pages and you want to provide real-time feedback to the user while they’re waiting on the function to complete (by function, I mean a method or a set of methods in the code-behind). So you put [...]
Dynamic Body ID and Class properties on ASP.NET Master Pages
16 Oct , 2009
Master pages are a great feature of ASP.NET. However, they do have some drawbacks, one being they do not easily offer the flexibility of dynamic body ids and classes that our design team here needs. Luckily a solution exists, and best of all it isn’t all that difficult to implement. The solution is built around [...]
