Wednesday, October 25, 2006

Designing gadgets and widgets for uploading files to Memba Velodoc

Requirements
  • A sender, a Receiver, a Subject, a Message, a File to upload and a checkbox to accept terms (see www.velodoc.net/login.aspx);
  • A progress bar to monitor upload progress;
  • A professional look & feel;
  • To be developed in 3 to 5 days max.
Reference documentation
Findings and impact on technologies
A windows sidebar gadget is a piece of DHTML hosted in the sidebar. Generally what you can do with DHTML can be done in a gadget.

There are limitations though, most of which are related to the browser security sandbox. Effectively a gadget is hosted locally, which has impacts on how it can communicate with remote web sites.

In particular, developing a file upload gadget with a progress bar in DHTML requires a cross-domain iFrame and scripting the iFrame in this case is forbidden. I have tried two nested iFrames which gives you scripting but the deepest iFrame opens in a new browser window instead of within the gadget. The only workaround I have found in half a day is to display the progress bar in a new browser window, but this does not look good and I was not prepared to lose more time.

So, I have considered XBAP WPF browser applications and although there is no File Upload control, I seem to have found the foundations for a file upload gadget here:

But WPF development is really early stage, development environment is primitive, documentation is lacking and I got worried about some warnings related to the sandbox that are mentioned in the literature quoted above.

In these circumstances, the only alternative was Macromedia Flash. I have even found a couple of examples running on the web. I have hosted them within an iFrame of a bespoke gadget and there I was: at the end of day one, I had my design and a fully functional (but ugly) prototype. Further documentation is available at:

Sunday, October 22, 2006

Choosing a GUI library for ASP.NET

You can get an exhaustive list of .NET components at http://www.componentsource.com/ but if you want a GUI library for ASP.NET, your choice is really between:
I would not recommend the other vendors for any of the following reasons:
  • Framework is not sufficiently exhaustive to cover 99% of the requirements;
  • Vendor has not been around for a sufficiently long time;
  • Updates are not sufficiently frequent to follow the pace of new developments like Ajax;
  • Developer license is not royalty-free and/or price is unaffordable;
Infragistics, Telerik and ComponentArt have very similar features, pricing and support when you do not dig into the details of each framework. See the Infoworld comparative article.

I generally find Infragistics to be a richer framework than Telerik and ComponentArt, with two drawbacks: (1) more complex to use and (2) fatter Javascript library to load on the client.

On the mid-term, ComponentArt may have taken a competitive edge by rewriting its components on top of the Microsoft Ajax framework (code-named Atlas).

On the long-term, it is difficult to predict the impact of WPF on web interfaces. On one hand, there is a need for richer interfaces that are easier to develop and Microsoft is committed to deliver the technology (WPF/E) and tools to achieve just that. On the other hand, WPF is really nothing more than Flash the Microsoft way, and very few web sites are developed with Flash yet although the Flash plug-in is available on 90% of internet PCs.

I have personally used Sheridan and now Infragistics controls for years, so I stick with them but if I had to make a new choice now, I would definitely opt for the rewritten ComponentArt controls.

Paypal IPN with UTF8

Today, I got stuck a couple of hours on implementing Paypal IPN with UTF-8 encoding. You get loads of examples on the Web and in the documentation with windows-1252 default charset but none with UTF-8 encoding.

Documentation led me to the wrong track, trying to set the charset and form-charset post fields to UTF-8, but this does not work. You always get a windows-1252 encoded notification.

When you search for the solution on Google, you mostly get complaints from developers who struggle with it and pretend there are bugs.

Finally, the solution is obvious (as always). Log to the Paypal web site and go to your profile.
Click the Language Encoding link.


Click the More Options button.



Select UTF-8 in the Encoding drop down list. That’s all!

Friday, October 13, 2006

SourceSafe 2005 issue fixed

More than 6 months ago, I have experienced an awkward problem with SourceSafe.

I periodically run the following script to launch the Analyze tool on SourceSafe databases:

Dim shell
Set shell = CreateObject("WScript.Shell")

Dim sVssAnalyzeCmd
Dim sVssAnalyzeExe
sVssAnalyzeExe = chr(34) & "C:\Program Files\Microsoft Visual SourceSafe\analyze.exe" & chr(34) & " -F -V3 -D "

'----------> First Project
sVssAnalyzeCmd = sVssAnalyzeExe & chr(34) & "d:\vss2005\project1\data" & chr(34)
shell.Run sVssAnalyzeCmd, 7, true

One day, Analyze was reporting the following error:

The file 0\DATA\\ is not a valid SourceSafe physical database file. It must be renamed to a file with an extension or moved to another directory outside the database.

I found a curious fix on the web: to work around this problem, rename the physical file for the database root. Use all uppercase letters in the new name.

I renamed d:\vss2005\project1\data\a\aaaaaaaa into d:\vss2005\project1\data\a\AAAAAAAA and it worked.

I am glad to realize that a fix has recently been made available by Microsoft at:
http://support.microsoft.com/kb/923842/en-us

Thursday, October 12, 2006

Useful networking tools

Today, I was working on integrating a web application with Paypal. My IPN handler in my development environment could not be reached by Paypal, although my test web server was published to the Internet.

Having searched for simple ways to test a Url from the Internet, I have found the following which I recommend: http://www.changedetect.com/cd-test-url.asp

[Updated on 22 Oct 2006]

Endeavouring to compare web hosting packages, I have used:
http://www.vertain.com/?sst

[Updated on 25 Oct 2006]

An excellent and still free web site monitoring service is available at:
http://site24x7.com/

[Updated on 6 Nov 2006]]

A comprehensive DNS toolset can be found at:
http://www.dnsstuff.com/

Preventing page caching and displaying “Page has expired” in ASP.NET 2.0

I have found two answers to this question:

Response.Buffer = True
Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0))
Response.Expires = 0
Response.CacheControl = "no-cache"

Source: http://www.extremeexperts.com/Net/FAQ/DisablingBackButton.aspx

Note that Response.Expires is deprecated in ASP.NET and Response.Cache.SetExpires should be used instead.

<%@ OutputCache location="none" %>

Source: http://www.syncfusion.com/FAQ/aspnet/WEB_c25c.aspx

More details at http://www.c-sharpcorner.com/asp/Articles/CachingInASPDPL.asp