ASP.NET 2.0 gives us a Page.Title property, which we can set in code, or in the Page directive. Great! Unfortunately, I had a requirement so that whilst I’d be setting a portion of the title from the page, the rest would be pre-defined (ideally within the master page that I use). Obviously you can’t fiddle the stuff in the server-side … Read more “Why is the HtmlHead class sealed?”
Category: Software Engineering
-
Multiple CSS Classes
I’m not sure I should really admit to not knowing this… but today was the first time I’d realised that the “class” attribute for elements within a HTML document can accept more than one class name. doh.
Update: Here’s a simple example. With the following in your style sheet…
.align-c { text-align: center; }.font-b { font-weight: bold; }
You can … Read more “Multiple CSS Classes”
-
Caching Method Results in ASP.NET 2.0 using Delegates
Hmm. Talk about over-engineering. I don’t think we really need generics at all, provided we’re happy with a cast outside the method instead of inside it.
public delegate object MethodExecution();public static object GetCachedMethod(string key, DateTime absoluteExpiration, MethodExecution method){ if (HttpContext.Current.Cache[key] == null) HttpContext.Current.Cache.Insert(key, method(), null, absoluteExpiration, Cache.NoSlidingExpiration);
return HttpContext.Current.Cache[key]; }…return (DataSet)GetCachedMethod(key, DateTime.Now.AddDays(1), delegate() { return SomeMethodThatReturnsADataSet(myParam); });… Read more “Caching Method Results in ASP.NET 2.0 using Delegates”
-
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”
-
Re-setting Identity Column in SQL Server
Discovered something new today – normally I’d just use the TRUNCATE TABLE command in order to reset an identity column in a table within SQL Server. However, SQL Server doesn’t let you do this if you’ve got foreign key constraints pointing at the table; so instead, I deleted all the rows using a standard DELETE statement, and then reset the … Read more “Re-setting Identity Column in SQL Server”
-
Atlas Preview Website Live
It looks like the Atlas preview site is now live at http://atlas.asp.net/ … time to start getting my AJAX slides updated!
-
Visual Studio 2005 RC
Visual Studio 2005 RC is now available to MSDN Subscribers. That’s all! :,,)
-
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”
-
*New* UK Windows Forms Mailing List
After some discussion over at the MsWebDev mailing list, I’ve now decided to launch an equivalent list for UK developers that want to discuss Windows Forms related and other .NET topics.
For more information, go to http://www.developerfusion.co.uk/mailinglists/winforms.aspx. Eventually we hope to offer NNTP and searchable Forum access to this courtesy of Community Server too.
Please spread the word!
-
VS 2005 Release Dates & UK Prices
Microsoft have now announced the UK (non-volume licensing) pricing of Visual Studio – see http://msdn.microsoft.com/howtobuy/vs2005/subscriptions/Default.aspx and the following release dates:
MSDN Subscriptions – 17th/18th October (for downloads), and on December update CD’s.Volume Licensing – 1st week of NovemberRetail – 1st week of December
:,,)
-
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…”
-
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”