RadAsyncUpload

Posted by Community Admin on 04-Aug-2018 22:10

RadAsyncUpload

All Replies

Posted by Community Admin on 31-Jan-2011 00:00

(Edit)Nevermind.

The RadAsyncUpload box isn't showing up under either add or edit I use the control in sitefinity.  It works fine running it visual and with sitefinity everything else shows up.

Additionally, I've tried changing all of the RadAsyncUploads to RadUploads but that doesn't show up either.  However, if a drag one of sitefinities RadUploads into a page it does show up.

Any ideas as to what I am missing?

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RotatorAdministration.ascx.cs" Inherits="RotatorAdministration" %>

 

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
            var uploadedFilesCount = 0;
            var isEditMode;
            function validateRadAsyncUpload(source, e)
                // When the RadGrid is in Edit mode the user is not obliged to upload file.
                if (isEditMode == null || isEditMode == undefined)
                    e.IsValid = false;

                    if (uploadedFilesCount > 0)
                        e.IsValid = true;
                   
               
                isEditMode = null;
           

            function OnClientFileUploaded(sender, eventArgs)
                uploadedFilesCount++;
           
           
        </script>

    </telerik:RadCodeBlock>
    <!-- content start -->
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <div>
        <telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" Width="97%" ShowStatusBar="True"
            GridLines="None" OnItemCreated="RadGrid1_ItemCreated" PageSize="3" OnInsertCommand="RadGrid1_InsertCommand"
            OnNeedDataSource="RadGrid1_NeedDataSource" OnDeleteCommand="RadGrid1_DeleteCommand"
            OnUpdateCommand="RadGrid1_UpdateCommand"
            onitemcommand="RadGrid1_ItemCommand">
            <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
            <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ImageId">
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton">
                        <HeaderStyle Width="3%" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridTemplateColumn HeaderText="Image Name" UniqueName="ImageName" SortExpression="Name">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblName" Text='<%# Eval("ImageName") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadTextBox runat="server" Width="200px" ID="txbName" Text='<%# Eval("ImageName") %>' />
<asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txbName"
ErrorMessage="Please, enter a name!" Display="Dynamic" SetFocusOnError="true" />
                        </EditItemTemplate>
                        <HeaderStyle Width="30%" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Description" UniqueName="ImageDesc" DataField="Description">
                        <ItemTemplate>
                            <asp:Label ID="lblDescription" runat="server" Text='<%# TrimDescription(Eval("ImageDesc") as string) %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="txbDescription" Width="300px" runat="server" TextMode="MultiLine"
                                Text='<%# Eval("ImageDesc") %>' Height="150px" />
                        </EditItemTemplate>
                        <ItemStyle VerticalAlign="Top" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="Data" HeaderText="Image" UniqueName="Upload">
                        <ItemTemplate>
                            <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("Image") %>'
                                AutoAdjustImageControlSize="false" Height="80px" Width="80px" ToolTip='<%#Eval("ImageName", "Photo of 0") %>'
                                AlternateText='<%#Eval("ImageName", "Photo of 0") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" OnClientFileUploaded="OnClientFileUploaded"
                                AllowedFileExtensions="jpg,jpeg,png,gif,bmp"
                                MaxFileSize="1048576" OnValidatingFile="RadAsyncUpload1_ValidatingFile" Visible="True" >
                            </telerik:RadAsyncUpload>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                   
                    <telerik:GridTemplateColumn DataField="Use" HeaderText="Use" UniqueName="BannerFlag">
                        <ItemTemplate>
                            <asp:CheckBox ID="cbUse1" runat="server" Checked='<%# GetBannerFlag( Eval("BannerFlag") ) %>'/>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:CheckBox ID="cbUse" runat="server" Checked='<%# GetBannerFlag( Eval("BannerFlag") ) %>' />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                   
                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton">
                        <HeaderStyle Width="2%" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton" />
                </EditFormSettings>
                <PagerStyle AlwaysVisible="True" />
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    <!-- content end -->

Posted by Community Admin on 18-May-2011 00:00

I second this request. I know Sitefinity 4 has a FileField control that we can use within our custom controls, but I'm having a hard time finding documentation on it. To my knowledge, FileField actually uses RadAsyncUpload

Posted by Community Admin on 20-May-2011 00:00

Hello Conrad ,

FileField uses RadUpload for Silverlight and the data is uploaded on chunks. I think that the default chunk size is set to 1 MB. We instantiate the Silverlight uploader on the client component.

Regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 22-May-2011 00:00

Is there an example of this for Sitefinity?

What I'm looking to do is give the user these options:

1. Upload a file (control returns the path to the file)
2. Select a file from the file system

This was something that you could do in Sitefinity 3.7 and was very helpful. Let me know if there is anything out there for this. 

Thanks

Posted by Community Admin on 26-May-2011 00:00

Hello ,

This is what RadUpload and RadFileExplorer controls support. Can you use one of them? RadAsyncUpload has an event OnClientFileUploaded that you can use to get json object about the uploaded file.

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed