This is a migrated thread and some comments may be shown as answers.

RadAsyncUpload files not uploading for first time

1 Answer 100 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Santhosh
Top achievements
Rank 1
Santhosh asked on 03 Jan 2013, 01:19 PM
Santhosh 
Hi,

I Am using RadAsyncUpload , when i first time open the page and upload at that time it will hung and it will not upload.If i refresh the page and upload then it will upload Properly.Another issue is i am using inside RadWindow RadAsyncUpload,but when i scroll down radwindow, RadAsyncUpload control is also moving with that.please please help,its Very very urgent.

Here is My Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Testupload.aspx.cs" Inherits="Testupload"
    MaintainScrollPositionOnPostback="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>AFE Addattachment</title>
    <%--<style type="text/css">
        .ruUploadProgress, li .ruCancel, li .ruRemove
        {
            visibility:visible;
        }
        li.ruUploading
        {
            height:1px;
        }
    </style>--%>
</head>
<body>
    <form id="form1" runat="server">
    <%--<asp:ScriptManager ID="ScriptManager1"  runat="server">
    </asp:ScriptManager>--%>
    <telerik:RadScriptManager ID="RadScriptManager2" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Outlook" />
    <%--<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
        EnableRoundedCorners="false" />--%>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
        function ClientFileSelected(source, eventargs) {
            var button = $find("<%= SubmitButton.ClientID %>");
            var button1= $find("<%= ExitButton.ClientID %>");
             button.set_enabled(true)
             button1.set_enabled(true)
             //$telerik.$(args.get_row()).addClass("ruUploading");
             }
             
//             var xPos, yPos;
//      var prm = Sys.WebForms.PageRequestManager.getInstance();

//      function BeginRequestHandler(sender, args) {
//        if ($get('<%=RadUpload1.ClientID%>') != null) {
//          // Get X and Y positions of scrollbar before the partial postback
//          xPos = $get('<%=RadUpload1.ClientID%>').scrollLeft;
//          yPos = $get('<%=RadUpload1.ClientID%>').scrollTop;
//        }
//     }

//     function EndRequestHandler(sender, args) {
//         if ($get('<%=RadUpload1.ClientID%>') != null) {
//           // Set X and Y positions back to the scrollbar
//           // after partial postback
//           $get('<%=RadUpload1.ClientID%>').scrollLeft = xPos;
//           $get('<%=RadUpload1.ClientID%>').scrollTop = yPos;
//         }
//     }

//     prm.add_beginRequest(BeginRequestHandler);
//     prm.add_endRequest(EndRequestHandler);


//var xPos, yPos;
//    var prm = Sys.WebForms.PageRequestManager.getInstance();
//    prm.add_beginRequest(BeginRequestHandler);
//    prm.add_endRequest(EndRequestHandler);
//    function BeginRequestHandler(sender, args) {
//        xPos = $get('RadUpload1').scrollLeft;
//        yPos = $get('RadUpload1').scrollTop;
//    }
//    function EndRequestHandler(sender, args) {
//        $get('RadUpload1').scrollLeft = xPos;
//        $get('RadUpload1').scrollTop = yPos;
//    }
        </script>

    </telerik:RadCodeBlock>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server" Height="300">
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
                    <Windows>
                        <telerik:RadWindow ID="RadWindow1" runat="server" Width="750" Height="300" RestrictionZoneID="RestrictionZoneID"
                            Behaviors="None" VisibleOnPageLoad="true" EnableShadow="true" Title="AFE AddAttachment">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td style="width: 60%" align="left">
                                            <asp:Label ID="AfeNum" runat="server" Text="AFENumber:"></asp:Label>
                                            <asp:TextBox ID="AFENUMBER" runat="server" Enabled="false" OnTextChanged="TextBox1_TextChanged"
                                                Font-Bold="true"></asp:TextBox>
                                        </td>
                                        <td align="right">
                                            <asp:Label ID="Label2" runat="server" Text="WellName:"></asp:Label>
                                            <asp:TextBox ID="WName" runat="server" Width="150px" Enabled="false" OnTextChanged="TextBox2_TextChanged"
                                                Font-Bold="true"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                                <table>
                                    <tr>
                                        <td style="width: 60%" align="left">
                                            Source File To Upload:
                                        </td>
                                        <td align="right" style="width: 19.5%">
                                            Document Type:
                                        </td>
                                    </tr>
                                </table>
                                <table>
                                    <tr>
                                        <td align="left">
                                            <div>
                                                <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
                                                <telerik:RadAsyncUpload runat="server" ID="RadUpload1" MultipleFileSelection="Automatic"
                                                    Localization-Select="Choose File" InputSize="55" OnClientFileSelected="ClientFileSelected" />
                                                <telerik:RadProgressArea runat="server" ID="RadProgressArea1" />
                                            </div>
                                        </td>
                                        <td align="char" style="width: 73%">
                                            <asp:DropDownList ID="DropDownList1" runat="server" Width="130px">
                                                <asp:ListItem>AFE</asp:ListItem>
                                                <asp:ListItem>Completion</asp:ListItem>
                                                <asp:ListItem>Drilling</asp:ListItem>
                                                <asp:ListItem Selected="True">General</asp:ListItem>
                                                <asp:ListItem>Geology</asp:ListItem>
                                                <asp:ListItem>Land</asp:ListItem>
                                                <asp:ListItem>Logs</asp:ListItem>
                                                <asp:ListItem>Marketing</asp:ListItem>
                                                <asp:ListItem>Permits</asp:ListItem>
                                                <asp:ListItem>Pipeline</asp:ListItem>
                                                <asp:ListItem>Regulatory</asp:ListItem>
                                                <asp:ListItem>Reserves</asp:ListItem>
                                                <asp:ListItem>Reservoir</asp:ListItem>
                                                <asp:ListItem>WellReports</asp:ListItem>
                                                <asp:ListItem>WBS</asp:ListItem>
                                                <asp:ListItem>Survey</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td align="right">
                                            <telerik:RadButton runat="server" ID="SubmitButton" Text="Upload files" Enabled="false"
                                                OnClick="SubmitButton_Click" />
                                            <telerik:RadButton runat="server" ID="ExitButton" Text="Exit" Enabled="true" OnClick="ExitButton_Click"
                                                Width="80" />
                                        </td>
                                    </tr>
                                </table>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label4" runat="server" Text="Upload Comments:"></asp:Label>
                                        </td>
                                        <td align="right">
                                        </td>
                                </table>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="TextBox4" runat="server" Height="35px" Width="580px" OnTextChanged="TextBox4_TextChanged"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </telerik:RadWindow>
                    </Windows>
                </telerik:RadWindowManager>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>



Thank You
Santhosh

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 08 Jan 2013, 12:12 PM
Hi Santhosh,

 
I have tested the code provided at  my side and it worked properly at my side. Here I am attaching my test web page and you the video of my test. Please review them and let me know what else should I do in order to reproduce the unusual behavior.

All the best,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
Santhosh
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or