Categories
ASP.NET Software Engineering

Caching Method Results in ASP.NET 2.0 using Generics & Delegates

Today I found myself coding a fairly familiar pattern – checking whether there was an entry in the ASP.NET cache with a particular key, if not, executing a method and adding the result to the cache, and either way, returning the result.

I wondered whether there was a “nice” way to do this using generics and anonymous delegates. This is … Read more “Caching Method Results in ASP.NET 2.0 using Generics & Delegates”

Categories
ASP.NET Software Engineering

Dynamically loading an IBindableTemplate

Want to dynamically load your two-way data bound templates rather than having to specify them inline? Well, unfortunately there’s no LoadBindableTemplate method in ASP.NET 2.0, but I’ve described a possible workaround at http://www.developerfusion.co.uk/show/4721/.

I also demonstrate how you can use this to load one portion of a two-way data bound template from one file (ie a common set of input … Read more “Dynamically loading an IBindableTemplate”

Categories
ASP.NET Software Engineering

ASP.NET “Page Not Found” when pages exist…

I hit a strange problem today when I started getting the ASP.NET 404 error page whenever I tried to access my ASP.NET pages through IIS – whilst any non-ASP.NET pages in the same directory worked fine. After a bit of digging, it turned out that this was caused by me fiddling with the site’s “home directory” in IIS – I’d … Read more “ASP.NET “Page Not Found” when pages exist…”

Categories
ASP.NET Software Engineering

Dynamically loading ASP.NET 2.0 “Bindable” templates

Update: See http://weblogs.asp.net/james_crowley/archive/2005/09/06/424539.aspx

Just found out that ASP.NET 2.0 doesn’t support dynamically loading “bindable” templates from a file; you’re restricted to writing them inline. In other words, if you’re using a FormView or DetailView control, and plan to use the new two-way data binding features, any use of LoadTemplate is out of the window. Plus the BindableTemplateBuilder (for creating a … Read more “Dynamically loading ASP.NET 2.0 “Bindable” templates”

Categories
ASP.NET Software Engineering

Tree structures in ASP.NET and SQL Server

I’ve just posted my latest article on Developer Fusion – Tree structures in ASP.NET and SQL Server, which takes a look at how you can store tree structures in SQL Server – and then doing something useful with them such as creating a web-directory like interface such as the one below.

I’d really appreciate any comments you might have …! … Read more “Tree structures in ASP.NET and SQL Server”

Categories
ASP.NET Software Engineering

Yet more ASP.NET 2.0 & Generics

Continuing on my ASP.NET 2.0/Generics adventure…. there also seems to be no way to specify that a Page or UserControl inherits from a class with a type parameter using the Inherits attribute – and doing this in the code doesn’t work, as the partial class declarations end up specifying different base classes.

Am I missing something elementary here?

Categories
ASP.NET Software Engineering

Generics in ASP.NET 2.0?

I’ve finally gotten around to having a closer look at the current Whidbey beta – particularly from the ASP.NET angle. However, I’ve got a fairly straightforward question that so far I haven’t been able to find any answer to – or even the slightest hint of one. Suppose I want to create a custom Web Control, that accepts a type parameter so … Read more “Generics in ASP.NET 2.0?”