Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had this exact same problem. I think what you are going to want to do is make a user control for each instance of the uploadify you want to have on your page. Example of my working uploadify control:</p> <pre><code> //ascx &lt;style type="text/css"&gt; .hidden { display:none; } &lt;/style&gt; &lt;script src="/Uploadify/jquery.uploadify.v2.1.4.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Uploadify/jquery.uploadify.v2.1.4.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Uploadify/swfobject.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="/Uploadify/uploadify.css" rel="stylesheet" type="text/css" /&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { var obj = document.getElementById('&lt;%= this.fileInput.ClientID %&gt;'); $(obj).uploadify({ 'uploader': '/uploadify/uploadify.swf', 'script': '/_handlers/Upload.ashx', 'cancelImg': '/uploadify/cancel.png', 'auto': true, 'multi': true, 'fileDesc': 'Image Files', 'fileExt': document.getElementById('&lt;%= this.uTypes.ClientID %&gt;').value, 'buttonText': 'Choose Images', 'folder': '/' + document.getElementById('&lt;%= this.fileDest.ClientID %&gt;').value, 'onAllComplete': function (event, queueID, fileObj, response, data) { var btn = document.getElementById('&lt;%= this.uploadButton.ClientID %&gt;').click(); } }); }); &lt;/script&gt; &lt;input id="fileInput" name="fileInput" type="file" runat="server" style="display:none" /&gt; &lt;input id="fileDest" name="fileDest" type="text" runat="server" style="display:none"/&gt; &lt;input id="uTypes" name="uTypes" type="text" runat="server" style="display:none"/&gt; &lt;asp:Button ID="uploadButton" runat="server" CssClass="hidden" OnClick="uploadButton_Clicked" CausesValidation="false"/&gt; </code></pre> <p>This is the code behind section of the control, some of the parameters you see are passed in externally</p> <pre><code> //Code behind public partial class UploadifyUpload : System.Web.UI.UserControl { private string fileDestination; public string FileDestination { get { return fileDestination; } set { fileDestination = value; } } private string uploadTypes; public string UploadTypes { get { return uploadTypes; } set { uploadTypes = value; } } public event EventHandler UploadButtonClicked; protected void Page_Load(object sender, EventArgs e) { string virtualPath = fileDestination.Replace(Request.PhysicalApplicationPath, "/"); virtualPath = virtualPath.Replace('\\', '/'); this.fileDest.Value = virtualPath; this.uTypes.Value = uploadTypes; } protected void uploadButton_Clicked(object sender, EventArgs e) { if (this.UploadButtonClicked != null) { this.UploadButtonClicked(this, new EventArgs()); } } } </code></pre> <p>I create the control like this and pass in a few variables. The file destination and click event are handled in the codebehind of whatever page is using the control.</p> <pre><code>&lt;mgmtControls:UploadifyUpload ID="uploadifyUpload" runat="server" UploadTypes="*.jpg;*.png;*.gif;*.bmp;*.jpeg" /&gt; this.uploadifyUpload.UploadButtonClicked += new EventHandler(UploadifyUploadClicked); this.uploadifyUpload.FileDestination = DocumentPath; </code></pre> <p>This works great for me in Firefox, Chrome, and IE, it should lead you in the right direction. You might want to consider adding a default upload option if the user doesn't have flash installed as well.</p> <p><img src="https://i.stack.imgur.com/jpSmo.png" alt="Multiple buttons working"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload