Forum


HomeHomePremiumPremiumDevelopmentDevelopmentUsing the  AsyncFileUpload control from the Asp.net Ajax Control Toolkit within a DNN moduleUsing the AsyncFileUpload control from the Asp.net Ajax Control Toolkit within a DNN module
Previous
 
Next
New Post
3/6/2014 7:15 AM
 

Hello,

Has anyone had any luck using the  AsyncFileUpload control from the Asp.net Ajax Control Toolkit within a DNN module?

I have it working in a plain asp.net project.

In DNN, it allows me to select a file, but when I click OK the javascript functions are not called. I've put some code below, cut from my more complex Edit.ascx control.

I removed teh line:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></ajaxToolkit:ToolkitScriptManager>

As I got an error in the event log which say you can't register the control twice.

Can anyone please help me? If you need more information, please let me know.

Steve


<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ContentItemUserControl.ascx.cs" Inherits="Netmonics.Modules.FlexiContent.ContentItemUserControl" %>
<%@ Register Src="~/desktopmodules/FlexiContent/UserControls/PageBehindUserControl.ascx" TagPrefix="uc1" TagName="PageBehindUserControl" %>


<%--<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>--%>


    <script type="text/javascript">


            //Determine the module id, set it as a url parameter, then upload the image.
            function ClientUploadStarted(sender, args) {


                alert("client upload started");
            }


            function uploadError(sender, args) {
                alert("An error occurred during uploading. " + args.get_errorMessage());
            }


            function uploadComplete(sender, args) {
                alert("upload complete");
            }


            function FileUploadComplete() {
                alert("FileUploadComplete");
            }
        });
 
    </Script>


    
 <div id="ContentItemImage">
    <%--<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></ajaxToolkit:ToolkitScriptManager> --%>       
    <ajaxToolkit:AsyncFileUpload     
        OnClientUploadComplete="uploadComplete" 
        OnClientUploadError="uploadError" 
        OnUploadedComplete="FileUploadComplete" 
        OnClientUploadStarted="ClientUploadStarted" 
        runat="server" 
        ID="AsyncFileUpload1" 
        Width="500px" 
        CompleteBackColor="White" 
        UploadingBackColor="#ff0000" 
        ClientIDMode="Static"
        ThrobberID="imgLoader"/>
    <asp:Image ID="imgLoader"  runat="server" ImageUrl="/DesktopModules/FlexiContent/images/top_icon_04.png"
    <asp:Image ID="imgDisplay" style="height:200px;width:200px;" runat="server" ImageUrl="/"
 </div>

 
New Post
3/11/2014 6:49 AM
 

Hello,

I went to the dnnchat.com site, where I was advised to use the dnn upload control instead.

Apparently. the ajax.net control kit gets tricky as different versions of the same dll can be required.

Best Regards,

Steve

 
New Post
3/12/2014 6:55 AM
 

Steve,

I agree with the folks at dnnChat.  I use the DnnFilePicker control to allow users to upload or select a file.  I have also used this ajax uploader:

http://valums-file-uploader.github.io/file-uploader/

I have code for both of these, so let me know if you need any help.

Thanks,
Scott

 
New Post
3/12/2014 7:38 AM
 

Hi Scott,

Thank you for your reply and kind offer of code.

I looked at the dnn file uploader but it interferes with other jquery in my module, and doesn't really provide the right functionality anyway it seems.

I wonder if you might be able to help me with an image upload problem I have.

What I'd like to achieve is the following:
1) Select an image so that it's displayed on a form.
2) Resize and cut the image on the page
3) Upload the image using an Ajax call to a web service

Can you advise on what the best approach to achieve this is?

Steve
 

 
New Post
5/14/2014 7:38 AM
 

Hello,

For anyone who might be interested, I achieved part of the above functionality using a JQuery plugin called JRAC

http://www.trepmag.ch/z/jrac/example/

It allows me to resize the image and selection box, I then sent the coordinates to the server and use C# to crop and save the image.

Still having trouble with the upload part, which works but causes a postback.

Steve

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentUsing the  AsyncFileUpload control from the Asp.net Ajax Control Toolkit within a DNN moduleUsing the AsyncFileUpload control from the Asp.net Ajax Control Toolkit within a DNN module



Try FREE
30 days money back guaranteed