FindControl() recursively using an Extension Method

by brad 26. January 2010 11:15
FindControl() is great if you’re looking for a control one level down, but if you’re making a dynamic control with n levels of child controls it can become a pain… Extension Methods to the rescue! Not only does it find the control your looking for at any level in the page, it also used generics to return the control without needing to cast it. /// <summary>/// Finds the control (Recursively) with an ID matching that given, of the Type requested. /// No need to cast either!/// </summary>/// <typeparam name="T">The type of control to return</typeparam>///... [More]

Tags:

ASP.NET | .NET 3.5 | C#

Is .NET 3.5's CompiledQuery slower than normal LINQ queries? Part 2

by Dominic Zukiewicz 31. March 2008 15:33
Updated: This article is 2 of the 2 posts about this problem (Problem AND Solution) The answer to this is definitely ... NO! When a colleague looked over my example, we shared some ideas about what LINQ is actually doing. It turns out that my LINQ version was working faster because it wasn't actually doing anything! By design, LINQ defers all processing until the data is actually used. Being assigned as it was wasn't enough! var q = from c in db.Customers where c.City == "London" select c; This only prepares the query, but no executi... [More]

Tags:

.NET 3.5

Is .NET 3.5's CompiledQuery slower than normal LINQ queries? Part 1

by Dominic Zukiewicz 24. March 2008 19:10
Updated: This article is 1 of the 2 posts about this problem (Problem AND Solution) Today, I looked into using LINQ and SQL together. I read about the CompiledQuery.Compile() method which can speed up queries because of the caching. So I decided to run the queries one by one and view the performance improvement. Unfortuantely, I witnessed that the Compiled version took over 20 times longer to run than the non-compiled. I will ask my Microsoft contacts to clarify this, but in the meantime, if you know why this is, please let me know. Pre-requisites Visual Studio 2008 Add a... [More]

Tags:

.NET 3.5

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar