ASP.NET 3.5 and above only

Obout.Ajax.UI Controls - File Upload - Upload images only

Here you can upload up to 10 MB of images on asynchronous postback.

(the following CheckBox doesn't effect on IE with version number less than 10)
Multiple selection:




ASP.NET
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.FileUpload" TagPrefix="obout" %>
<script type="text/JavaScript">
function onClientBeforeUpload(sender, args) {
   $get("<%= label.ClientID %>").innerHTML = ""
   return true;
}
// on checkbox changed
function multipleChanged() {
   // FileUpload component
   var fileUpload = $find("<%= fileUpload1.ClientID %>");
   // inner input (type="file") field
   var inputFile = $get(fileUpload.get_inputFile().id);
   // set/unset multiple selection
   inputFile.multiple = $get("checkbox").checked;
   $get("checkbox").checked ? inputFile.setAttribute("multiple", "true") : inputFile.removeAttribute("multiple");
}
// on page load
function pageLoad() {
   // test the checkbox 
   multipleChanged();
}
</script>
...
<asp:UpdatePanel runat="server" ID="UpdatePanel1"><ContentTemplate>
Multiple selection: <input type="checkbox" id="checkbox" checked="checked" onchange="multipleChanged()" />
<br /><br />
<obout:FileUpload OnClientBeforeUpload="onClientBeforeUpload" Accept="image/*""
       ValidFileExtensions="jpeg;jpg;gif;tiff;png" MaximumTotalFileSize="10240"
       Width="250px" runat="server" id="fileUpload1" BrowseFieldDescription="Images"
/>
<br /><asp:Button runat="server" ID="submit" Text="Upload files" /><br /><br />
<asp:Label runat="server" ID="label" Text="" />
</ContentTemplate></asp:UpdatePanel>

"Perfect! Honestly, you guys make me look brilliant. Your components offer a dynamic, and professionally designed experience for my users. The TreeView has been invaluable to me, huge datasets and enormous hierarchies are a snap. However, when you first introduced the CALLBACK, you rocked my world! Having moved from desktop to web applications, I missed the functionality I used to have. You gave it back - thank you. I can't tell you the number of times I've been asked "How'd you do that?" (even from our tech support and contractors)."

John Cappelletti

Random testimonial   All testimonials