Wednesday, October 01, 2008

NeatUpload - File Upload Open Source Library

NeatUpload is a very nice open source ASP.NET component which allow you to make file uploads to file system or database storage with customized AJAX-like progress bar indicators. The library is made in .NET and it works under Mono's XSP/mod_mono or Microsoft's ASP.NET implementation. You can easily download the source code and even modify it to match the required behavior of your project.

The library features 2 custom web controls: InputFile allows the user to select a file to upload, and ProgressBar displays the upload progress either inline or in a popup. ProgressBar uses AJAX-style refreshless updates on modern browsers when JavaScript is available, but also allows users without JavaScript to see upload progress. HttpModule is included as well to get the upload progress and handle the upload context states.

You can download and give it a try from this link: Brettle Development NeatUpload


Microsoft and jQuery Engagement

It seems that Microsoft is going to include jQuery by default in the new releases of Visual Studio and ASP.NET MVC in the near future. jQeury is a very nice and handy Javascript library which has an increasing acceptance recently in the web development community. Here is a part of the John Resig post in jQuery Blog about this news:


Microsoft is looking to make jQuery part of their official development platform. Their JavaScript offering today includes the ASP.NET Ajax Framework and they’re looking to expand it with the use of jQuery. This means that jQuery will be distributed with Visual Studio (which will include jQuery intellisense, snippets, examples, and documentation).

Additionally Microsoft will be developing additional controls, or widgets, to run on top of jQuery that will be easily deployable within your .NET applications. jQuery helpers will also be included in the server-side portion of .NET development (in addition to the existing helpers) providing complementary functions to existing ASP.NET AJAX capabilities.


Javascript - Access Denied When Calling Window Opener

We usually use the "open" method in the window object to open a new window in Javascript. However, sometimes you need to change some values in the parent window depending on the changes of the new window elements values or you may need to call a method in the parent window from the child one. To do so, you can use the "opener" property in the window object to access the parent page elements. The following Javascript statement access an input element in the parent window with "txtEmail" ID and update its value:

window.opener.document.getElementById("txtEmail").value = "mohammedn@mailhost.com";
You can even call a method direct in the parent window from the new opened one:
window.opener.SomeMethodInTheParentWindow();
However, you may get "Access Denied" or "Permission Denied" message when trying to access the "opener" property in the popup window. This usually because you call the window.open with the full path of the pop window:
window.open('http://www.domain.com/accounts/register_popup.aspx');
To resolve this issue, use the relative path of the popup page instead of the full path when opening it and you will be able to safely access the opener property of the window.
window.open('accounts/register_popup.aspx');