I dealt with a very annoying issue today involving an ASP.NET 3.5 Web Application being compiled to a single assembly through a Web Deployment Project in Visual Studio 2008. The Web.config file contains a number of mappings to ensure that the correct 3.5 Controls and dependent assemblies are loaded by ASP.NET as runtime.
It seems as though some controls, including the ListView, require that the Web.config file must be present as part of the Web Deployment Project output files. If not present, you will receive the following error when building the Web Deployment Project:
- Unknown server tag ‘asp:ListView’
To replicate:
- Create new Web Application project
- Edit Default.aspx by adding ListView control
- Create Web Deployment Project for Web Application
- Edit Web Deployment Project file and add the following line to the <ItemGroup>:
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\*.config" />
- Build the Web Deployment Project
- Observe build failure as described above
I’m not sure if this is a bug with the Web Deployment Projects, but it is certainly rather annoying as this was the last place I though of looking for the resolution.
Microsoft released the ASP.NET Charting Control for .NET 3.5 SP1 on Tuesday and it looks very promising indeed. This isn’t entirely surprising seeing as this control was bought from Dundas before being released as a free download, rather than developed my Microsoft in-house. Downloading and viewing the Samples Pack reveals just how powerful this tool is, and how it can be seamlessly integrated with just about any data source.
I’m not entirely sure what Dundas have achieved by basically creating themselves a new competitor by allowing Microsoft to give the product away for nothing. Unless they are expecting users to want to ‘upgrade’ to the Flash-based Dundas charting tools which are not provided as part of this control.
Happy charting!
We use a lot of Virtual Machines at work (mostly using VMWare) and unfortunately they are not always configured with sufficient disk space. If you need to increase the space allocated to an existing drive then check out the following article for step-by-step instructions:
The open source disk partitioning software recommended in the article also seems to work a treat once the space has been increased.
Google will today release the beta version of their first foray into the browser arena with Google Chrome. Apart from a pretty lame name, what is the search giant offering in the first of its planned iterative product release?
- Proper multi-processing, allowing JavaScript (for example) within tabs to execute separately from other tabs and processes within the browser
- Intelligent memory management
- Runs on the open source WebKit engine already used in Google’s Android mobile handset operating system
- Automated compatibility testing across millions of existing web pages
- Shortcuts to common browser functions, such as custom search
- Decent popup management
- Web applications given their own chrome to feel more like desktop apps
- Intuitive security model providing proper process sand-boxing
- Always-active phishing signature updates
All in all this sounds like a pretty promising package but I’ll remain dubious until the beta is released later today and we can have a play ourselves. One does wonder how Google Chrome may affect the great work of the Mozilla project but they seem pretty satisfied by the new Firefox competitor.
The next version of Microsoft’s Internet Explorer looks like it will be the most ‘compliant’ yet, with full CSS 2.1 even partial CSS 3 support promised in IE8.
But the general public don’t really care about Acid2 and the like. What they want are USPs such as Visual Search, which actually looks quite smart.
A work colleague of mine made me aware of the rather useful CacheDependency class the other day and I’ve been implementing this in various places since. It is useful when you wish to store some data in an ASP.NET web application’s Cache but wish that data to remain in the Cache according to an external influence rather than a time frame.
For example, if you had a typed DataSet and stored some XML that conformed to its Schema on disk, you could use CacheDependency to store the data in the Cache until such time as the physical file is modified.
public static MyDataSet GetDataSet(string path)
{
if (HttpContext.Current.Cache["MyDataSet" + path] == null)
{
MyDataSet ds = new MyDataSet();
try
{
ds.ReadXml(HttpContext.Current.Server.MapPath(path));
}
catch (Exception ex)
{
throw new MyException(string.Format("Unable to load file '{0}' as a MyDataSet", path), ex);
}
CacheDependency dependency = new CacheDependency(HttpContext.Current.Server.MapPath(path));
HttpContext.Current.Cache.Insert("MyDataSet" + path, ds, dependency);
}
return HttpContext.Current.Cache["MyDataSet" + path] as MyDataSet;
}
In the example above, when the file located at path is modified, the Cache will be cleared due to the dependency. When GetDataSet() is next called, the latest version of the file will be loaded into the Cache instead.
Don’t you hate it when you need to do something so basic that you just can’t fathom the best way to achieve it? No? OK, it’s just me then.
What if you’ve just got a basic HTML anchor that you want to run some JavaScript event off, such as onclick, but don’t want the browser to go to the ‘top’ of the page when actioned? The following will shift to the top of the page when clicked:
<a href="#" onclick="alert('Clicked');">Click me</a>
but the following will not, as expected:
<a href="javascript:void(0);" onclick="alert('Clicked');">Click me</a>
Simple when you know how!
Hello and welcome to my new technical blog!
This is where I’ll be posting various useful findings that I would like to share with the world during my time as a web developer.
“Why have you waited 12 years?” I hear you ask. I cannot answer that. No excuses.