RadAsyncUpload hides whn trying to use some client-side scripting ?

2 posts, 0 answers
  1. Bazz
    Bazz avatar
    21 posts
    Member since:
    Aug 2011

    Posted 13 Jan 2014 Link to this post

    Hi,

               <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" Skin="Black" 
                    TargetFolder="~/Uploads" TemporaryFolder="~/Uploads/TempFiles" DropZones=".DropZone1" 
                    MultipleFileSelection="Automatic" UploadedFilesRendering="BelowFileInput" 
                    Width="300px" onclientfileuploaded="setGaugeValue();"></telerik:RadAsyncUpload>

                    <script type="text/javascript">
                        function setGaugeValue() {
                            $find("<%=UploadedFileGauge.ClientID %>").set_value($get("<%=UploadedFileGaugeHiddenValue.ClientID %>").value);
                        }
                </script>

    ...I'm trying to update the gauge value on the client side, each time a file is uploaded (won't work using the RadAsyncUpload1.FileUploaded event handler on the server-side). But...if I put in a call to some client-side JavaScript the gauge hides on my web page.

    Please advise,

    Bazz

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jan 2014 Link to this post

    Hi,

    I guess that you are setting a Hidden field value to RadRadialGauge on OnClientFileUploaded event. Please have a look into the following code snippet which works fine at my end.

    ASPX:
    <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" Skin="Silk" TargetFolder="~/Uploads"
        MultipleFileSelection="Automatic" UploadedFilesRendering="BelowFileInput" Width="300px"
        OnClientFileUploaded="setGaugeValue">
    </telerik:RadAsyncUpload>
    <asp:HiddenField ID="UploadedFileGaugeHiddenValue" runat="server" Value="10" />
    <br />
    <telerik:RadRadialGauge runat="server" ID="UploadedFileGauge" Width="300px" Height="300px">
        <Pointer Value="2.2">
            <Cap Size="0.1" />
        </Pointer>
    </telerik:RadRadialGauge>

    JavaScript:
    <script type="text/javascript">
        function setGaugeValue(sender, args) {
            $find("<%=UploadedFileGauge.ClientID %>").set_value($get("<%=UploadedFileGaugeHiddenValue.ClientID %>").value);
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top