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>

"I just waned to give you all many thanks for the level of support you provide. I have dealt with a few 3rd party software providers and have never seen this level of support anywhere. This on top of an awesome set of .NET controls that adds so much to a web application. I can't thank you guys enough. Keep up the good work and I look forward to seeing even more first class controls from Obout."

Mohsen Kashani
Contractor

Random testimonial   All testimonials