How to requierd validate a RadAsync in Radwindow?

2 posts, 0 answers
  1. shemein
    shemein avatar
    28 posts
    Member since:
    Mar 2014

    Posted 25 Sep 2014 Link to this post

    I have a Radwindow like this:
    <telerik:RadWindowManager ID="ImportRadWindowManager" runat="server" >
    <telerik:RadWindow runat="server" ID="ImportRadWindow" EnableShadow="true" Width="400px" Height="210px" Modal="true">
    <div style="text-align: center;margin:15px">

    <telerik:RadAsyncUpload ID="PriorRadAsyncUpload" runat="server" Width="220px" Style="margin-bottom: 0px" MaxFileInputsCount="1" ValidateRequestMode="Enabled" AllowedFileExtensions=".CSV,.EX1" InputSize="37" TemporaryFileExpiration="10.00:00:00" OnFileUploaded="PriorRadAsyncUpload_OnFileUploaded">
    <span style="margin: 0px; padding: 0px; font-size: 11px; color: #808080; font-style: italic; font-family: Arial, Helvetica, sans-serif; font-size:8pt;" >Select files to upload (.CSV,.EX* ) </span><br/>
    <asp:CustomValidator runat="server" ID="CustomValidator" ClientValidationFunction="validateUpload" ErrorMessage="Error" />
    <telerik:RadButton ID="btnUploadRadButton" CausesValidation="true" runat="server" Text="Import" OnClick="btnUploadRadButton_OnClick"></telerik:RadButton>
    <telerik:RadButton ID="btnCancelRadButton" runat="server" Text="Cancel" OnClick="btnCancelRadButton_OnClick"></telerik:RadButton>


    When I click on the yes delete button the parent page gets postback. when the postback happens the radwindow gets closed. I need to validate the AsyncUpload inside the radwindow. Would you please help me?
  2. Marin Bratanov
    Marin Bratanov avatar
    3908 posts

    Posted 26 Sep 2014 Link to this post


    Could you explain in more detail what exactly you need to perform as validation. I am asking this, because a lot of the setup depends on your needs:

    • RadWindow closes because the postback disposes it. To avoid this you need to use AJAX:
    • With file uploads, however, you need a full postback at some point so the files can travel to the destination folder, so using AJAX may not be an option.
    • You can consider using the VisibleOnPageLoad property of theRadWindow and resetting it to false when needed:
    • You can also consider moving this upload functionality to a separate aspx page that you can load in the RadWindow. This is, perhaps, the simplest option, because at this point the content page has its own context and postbacks inside do not affect the parent or the RadWindow.

     I also advise that you keep RadWindows whose ContentTemplate is used outside of a RadWindowManager.

    I hope this information helps you choose the approach most suitable for your setup.


    Marin Bratanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top