October 2003 - Posts

Yoehoe! Check out www.asp.net/whidbey to see some of the great features in ASP.NET v2.0 (currently in an alpha stadium). There are really a lot of cool features out there, visit Rob's blog on http://weblogs.asp.net/rhoward to get regular updates and a sneak preview of the great ASP.NET Cache Database Invalidation feature...

Some of the great new features:

  • Concept of master pages
  • Cache invalidation with databases
  • A bunch of new controls such as Treeview, FileUpload, Wizard, ImageMap, BulletedList and so much more
  • Dynamic images using the .asix handler and asp:DynamicImage
  • New forms authentication building blocks (control to reset forgotten passwords and so on)
  • Visual Studio .NET “ Whidbey“ enhancements:
    • Built-in webserver based on “Cassini“ (cf. ASP.NET Web Matrix)
    • Build apps without FPSE (just in a local folder)
    • Support for code-behind as well as embedded script
    • IntelliSense everywhere, also in script blocks (<% ... %>)
    • Web site publishing
    • Editing of FTP sites
  • Better mobile support
  • Browser validation support
  • Better .NET Framework with support for ACLs etc
  • Avoid a slow first time request (precompilation)
  • Configuration tool to add users/roles, datasources, personalisation features once a site is released.
  • Navigation with sitemaps (based on XML) and SiteMapPath control

Already experimenting with Whidbey on my machine... Enjoy the bits and bytes quite soon :)

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

I like the .NET Framework very much but there are still a lot of things which are not in there today (but which will be covered in Whidbey). Just think of setting permissions on files and folders. Fortunately there are some great libraries to help people with this ugly task, e.g. http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9. Today I had to fight with my C# code to get a share to work from within managed code. Not that easy but a pain to debug as well... For those interested this is the tricky Win32 call:


private static extern int NetShareAdd(
string server, Int32 dwLevel, IntPtr buf, IntPtr parm_err);

It did the trick, however there were some issues to get it right... Never use a backslash at the end of a path, for example c:\temp\. This call doesn't like that at all and returns a great error with number 123 :) The Platform SDK was a must to sort it out while debugging. But finally, everything is working great. So, this problem did not affect my great love: .NET :)

Can't wait to get it to work in "Whidbey"...

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Do you need to convert large amounts of files from one format to another? I have to do it for my articles on www.msdn.be... So what? Well, I don't like to do the same action all over again. Here's the classic way about how to do this:

  1. Windows-key + R, mspaint, OK
  2. CTRL-O, file1.bmp,
  3. ALT-F, A, file1.jpg, , J,
  4. Resume with step 2 till all the files in the folder are converted

I'm a developer and computers are great to do the same work all over again without complaining. Do you know secretaries? The are suited for such a job as well, but they will probably start to complain about their job... So, I'm a developer and what developers do is this: I have 10 minutes to complete this boring job, so I'm writing for 9 minutes a program which can do the job for me in less than 1 minute (and the development is not boring but exciting).

Let's give you the most important part of the code:

string dir = Directory.GetCurrentDirectory();
foreach(string i in Directory.GetFiles(dir,"*.bmp"))
FileInfo info = new FileInfo(i);
     Console.WriteLine("Processing {0}",info.Name);

     Image img = Image.FromFile(info.FullName);
     string name = info.Name.Substring(0,info.Name.Length - info.Extension.Length);
     img.Save(dir + "\\" + name + ".jpg",ImageFormat.Jpeg);

I made this code a little better using a console application which takes some parameters for the original and destination file format. Take a look at System.Drawing and System.Drawing.Imaging. These are wonderful namespaces!

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Today I've been working on the alpha release of Whidbey. I cannot say a lot about this technology yet, but here's just one thing: ASP.NET v2.0 really rocks :). People who know me will know how excited I am about ASP.NET v1.x and the entire .NET Framework. I'm even more excited about this new software which will be released next year (codenamed "Whidbey"). For those who attend the PDC this month in LA, there will be some sessions covering ASP.NET v2.0. For more information, take a look at Rob's blog on www.rob-howard.net. I heard the Whidbey alpha bits will be presented (and may be redistributed) on this event.

So, what are the major features? Let me give a quick summary:

  • Better development environment which is very intuitive for the developer and supports more scenarios (code-behind or mixed code, as it's implemented in the Web Matrix).
  • The IDE comes with an integrated mini webserver to run apps locally (compare with Web Matrix's web server Cassini).
  • Better performance thanks to precompilation and improved caching (database invalidation).
  • A bunch of new controls useful controls for things such as personalization, navigation, file upload, tree views, etc.
  • Support for new data sources based on XML, site content, etc.
  • Improved mechanism for security.
  • Built-in management/configuration tool for (deployes) web apps.
  • "Master pages", themes and templates
  • Much much more.

It's all quite amazing stuff actually. ASP.NET v2.0 will definitely cause a feeling of "the sky is the limit" for website developers. A lot of common tasks are built-in in this new version and we'rfe still in an alpha phase... Again a lot of exciting months to go :)

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

One of the features in ASP.NET I like most is the support for output caching. Today I've been writing an HTTP handler in ASP.NET (see earlier post) and I've added support for caching to the application. The Microsoft Application Center Test (ACT) tool confirmed the power of this caching feature. The result: a performance gain of 800% !!!!! If you don't believe me, just wait for my next article on MSDN Belux covering this exciting technique.

Remark: In ASP.NET v2.0 "Whidbey", ASP.NET Caching will be even better with database invalidation support etc. For more about caching check out MSDN TV on http://msdn.microsoft.com/msdntv (episode of Rob Howard) and the blog of Rob himself on www.rob-howard.net. There's an intersting story about BillG participating in a discussion about LRU caches and the implementation in .NET.

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

My second article on "Hosting the ASP.NET runtime" was released on www.msdn.be today. In this article I cover the ability to run ASP.NET applications from a cd-rom using the lightweight Cassini webserver. Give it a try!

The direct link to the article is http://www.microsoft.com/belux/nl/msdn/community/columns/desmet/hostaspnet2.mspx. You'll find a link to the binaries over there as well.

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

I'm currently writing a (in my opinion great) article for MSDN Belux on HTTP Handlers in ASP.NET. This feature is really cool (as most features in ASP.NET). I've implemented the first part of the solution today during my train trip from Ghent (where I study) to Zottegem (where I live) in about half an hour. Yes, everything worked immediately ;-).

To reveal something of the solution already: it's a photo library thing. Okay, there are tons of those things on-line, but in my solution you don't have to:

  • create thumbnails for every photo
  • add .aspx files to every folder you want to "photo gallery"-enable

Just copy the image files to the server and it will appear in the photo gallery. No more thumbnail nightmares, isn't this cool? Tomorrow I'll write another part of the article (on the train I guess). Still have to complete another article on SQL Server Notification Server (which is very cool as well).

So, check out MSDN Belux regularly on www.msdn.be to stay in touch!

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

What is it?

RSS stands for RDF Site Summary, an XML-based system to retrieve the actual contents of another site in a client-application (for example, a Windows Forms client reader application). Real techies want to know what RDF is of course, okay here it is: Resource Description Framework. I like RSS very much, it can provide the latest news from other site on your own site, which is very handy to centralize things on one location. For example, I made an RSS reader application in ASP.NET on www.bartdesmet.net/news. You'll find news of ZDNet Belgium and MSDN (both worldwide and local) over there. Last week MSDN Belux released RSS on its site as well. You'll find more info on http://www.microsoft.com/belux/nl/msdn/rssfeed.mspx.

How to consume it?

This is not difficult at all. Use an ASP.NET Xml control (asp:Xml) and set both the Document and Transform properties. The Document property should point to the XmlDocument instance for the XML source file; the Transform points to an XslTransform instance which takes an XSLT and transforms the source XML to HTML. Here's a little example:

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<%@ OutputCache Duration="60" varyByParam="*" %>


<script language="VB" runat="server">
    Sub Page_Load(Sender As Object, E As EventArgs)
        Dim doc As XmlDocument = New XmlDocument()
 Dim URL As String = "
  Response.Write("Invalid RSS feed")
 End Try

        Dim trans As XslTransform = new XslTransform()

        xml1.Document = doc
        xml1.Transform = trans
    End Sub

    <form runat=server>
        <asp:Xml id="xml1" runat="server" />


and here's the .xsl file:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/rss/channel">
 <b><font face="verdana" size="4"><xsl:value-of select="title" /></font></b><br/>
 <i><font face="verdana" size="3"><xsl:value-of select="description" /></font></i><br/><p/>

 <xsl:apply-templates select="item" />

  <xsl:template match="item">
 <b><font face="verdana" size="3"><xsl:value-of select="title" /></font></b>
 <font face="verdana" size="1"><i> (<xsl:value-of select="pubDate" />)</i></font><br/>
 <font face="verdana" size="2"><xsl:value-of select="description" /></font><br/>
 <font face="verdana" size="1"><a href="{link}">More...</a></font><hr/>

Remark: use ASP.NET caching to improve the performance of the page (avoiding the need to go to the XML source on every request).

Happy RSSing ;-)

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

I've been working at the College of Zottegem today (my good old school ;-)) on the IT-infrastructure. During the summer holiday we (Hans, Nick and myself) spent about 3 weeks working on a new infrastructure based on Windows Server 2003, Exchange 2003, Windows XP and 2000 Professional clients, Terminal Services, SQL Server 2000, Windows SharePoint Services, ClassServer, etc. After some struggles with folder redirection, ACLs etc everything is working great. The server back-end contains 4 servers, called nero (our internet-router server and anti-virus server), einstein (DC, DNS, DHCP, ...), socrates (mail and secondary DC, DNS + SUS, IIS 6, WMP 9, SQL) and plato (file server, SQL Server, intranet server, ...). Unfortunately plato went down in the first week of the new schoolyear due to a burned motherboard :(((. The other 'guys' are behaving well.

I even learned something new today (yes, that's possible, sure). While I was investigating some troubles with the replication between the DCs in the domain, I noticed that the student accounts in the security group 'Students' (in dutch, Leerlingen) had a gray hair color instead of a black one (which is the case for the teachers in their group). I can assure it looks funny. In first instance I thought this caused my replication problem, but it seemed to be a normal behaviour. When I tested this on my laptop as well (creating thousand accounts and joining these to a group), the same thing occurred: the hair color changed ;) Btw: those 1000 accounts were created on the fly with a little C# program:

DirectoryEntry entry = new DirectoryEntry("LDAP://jefken/OU=Test,DC=bartdesmet,DC=local");

i = 0; i < 1000; i++)
     string login = "Test" + i.ToString();

     DirectoryEntry usr = entry.Children.Add("CN=" + login,"user");
     usr.Properties["userPrincipalName"].Add(login + "@bartdesmet.local");


Googling on the internet had this result: http://support.microsoft.com/default.aspx?scid=kb;en-us;281923. It seems that groups with more than 500 members get a new hair color :-). Cool feature, isn't it?

PS: Jefken is the name of my new laptop... just this and nothing more than this.

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

From Monday October 13th you'll be able to request your own blog on my website via www.bartdesmet.net/blogs. I'll be more than happy to host your blogs on my machine. Check it out!Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

More Posts Next page »