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

How to requierd validate a RadAsync in Radwindow?

1 Answer 33 Views
Window
This is a migrated thread and some comments may be shown as answers.
shemein
Top achievements
Rank 1
shemein asked on 25 Sep 2014, 12:59 PM
I have a Radwindow like this:
<telerik:RadWindowManager ID="ImportRadWindowManager" runat="server" >
<Windows>
<telerik:RadWindow runat="server" ID="ImportRadWindow" EnableShadow="true" Width="400px" Height="210px" Modal="true">
<ContentTemplate>
<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">
</telerik:RadAsyncUpload>
<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>

</div>
</ContentTemplate>
</telerik:RadWindow></Windows>
</telerik:RadWindowManager>

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?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Sep 2014, 12:26 PM

Hello,

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: http://www.telerik.com/help/aspnet-ajax/window-ajaxifying.html.
  • 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: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-opening-from-server.html.
  • 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.


Regards,

Marin Bratanov
Telerik
 

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.

 
Tags
Window
Asked by
shemein
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or