Thursday, July 29, 2010

IZWebFileManager 2.6 release is out

Welcome the new generation of IZWebFileManager - v2.6

What's new?

1. Multiple files upload.
File upload bar allows you to select more then one file to upload at once.

I added two new resource keys to support localization:

Upload_Another_File - default value "Upload Another File", text of the link bellow the browse file box.

Upload_File_Remove - default value "Remove", text of the link near to each of browse file boxes.

To enable localization of this texts just add a proper resources to WebFileManagerResource.XXX.resx suitable you locale.

2. Upgraded to VS 2010/.NET 3.5.
Since this release using of IZWebFileManager requires .NET 3.5 or higher.

The release is available for download from Google Code

What's next?

In current implementation I use reflection to access some not public API. That causes application fail when run in Medium trust environment. (

So, in the next release I will solve this problem.

Thanks for support!

Thursday, July 22, 2010

HtmlTextWriter fluent interface

When working on new features in IZWebFileManager I needed to change rendered HTML.

I took a look at the code I wrote more then 3 years ago.... It is so complicated!

IZWebFileManager is a typical custom control that overrides Render and uses HtmlTextWriter's API to produce HTML. Here is a small part of the rendering flow:

It took me a while to figure out what is HTML is rendered here.
The fact is, that HtmlTextWriter's API is not intuitive and requires a lot of effort to produce relatively simple HTML. Is there a alternative way to render output?

WhenLINQ has been released all the .NET world has met fluent APIs, and I was wandering if there is such an API for rendering ASP.NET controls.

I found this one:

I've just added it to my project (made it internal to prevent collisions), changed it a bit and rewrote the code above:

Now it is much easier to change the rendered HTML, because this code flow is much closer to the HTML markup flow, than when it was written using the "classic" HtmlTextWriter API.