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

RadAjaxManager / FullPostback / download...response.End : Error

1 Answer 124 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Iron
Iron
Vincent asked on 19 Apr 2020, 09:31 PM

Hi from France, from my home...

normally, I'm on vacation since Friday evening, but I had a problem with the finalization of my project during the weekend.

And i need help !

 

I've got an RadAjaxManager, 2 buttons set as PostBackControls

this buttons are in listview, this listview is ajaxified

Each item in listiew contains for clic on

2 radiobutton (grouped) AjaxPostback to set in database is selected and other things

2 buttons (1 per radiobutton) to download a generated document from Database and they must set a fullpostback on clic

uploadViewbutton ajaxPostback for opening a panel.to view Upload Zone (and put element id Selected in upload button commandArg)

My problem is i clic on fullPostback Buttons i've an error :

 

Sys.WebForms.PageRequestManagerParserErrorException: Sys.WebForms.PageRequestManagerParserErrorException: Impossible d'analyser le message reçu du serveur. Cette erreur peut avoir plusieurs causes possibles : réponse modifiée par des appels à Response.Write(), filtres de réponse, HttpModules ou activation de trace du serveur.
Détails : Erreur d'analyse à proximité de 'PK

My code behind fullpostback to download document :

With Response
           Dim filename As String = strLibelle & "." & strExtension
           .Clear()
           .ContentType = strType
           .AddHeader("Content-Disposition", "attachment; filename=" & filename)
           .AddHeader("content-length", bFile.Length.ToString)
           .BinaryWrite(bFile)
           .End()
       End With

 

My Aspx :

<asp:ScriptManager ID="SM1" runat="server"/>
        <telerik:RadAjaxManager ID="RAM1" runat="server" UpdatePanelsRenderMode="Inline" PostBackControls="btro;btrs" >
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="btrsUp">
                    <UpdatedControls>                       
                        <telerik:AjaxUpdatedControl ControlID="pZoneUpload" />                       
                    </UpdatedControls>
                    </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btJoindreCCTP">
                      <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pJoindreCCTP" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                 <telerik:AjaxSetting AjaxControlID="ro">
                      <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cctpList" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                 <telerik:AjaxSetting AjaxControlID="rs">
                      <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cctpList" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                 <telerik:AjaxSetting AjaxControlID="btUploadDoc">
                      <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cctpList" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>           
        </telerik:RadAjaxManager>
 
<telerik:RadWindow runat="server" ID="rwCCTP" Title="CCTP - Paramétrage" VisibleStatusbar="false" Modal="true" Behaviors="Close, Move" AutoSize="true" Skin="Default" RenderMode="Lightweight">
                <Localization Cancel="Annuler" Close="Fermer" Maximize="Agrandir" Minimize="Réduire" No="Non" PinOff="Détacher" PinOn="Attacher" Reload="Recharger" Restore="Restaurer" Yes="Oui" />
                <ContentTemplate>
                    <section id="CCTP-edit">
                        <header>
                            <h2><asp:Literal runat="server" ID="CCTP_Title"></asp:Literal></h2>
                            <asp:Literal runat="server" ID="CCTP_DetailCompo"></asp:Literal>
                            <asp:Panel ID="pJoindreCCTP" runat="server" CssClass="pjoindreCCTP">                               
                                <asp:Label runat="server" ID="ll" Text="Joindre les CCTP lors de l'impression :"></asp:Label>
                                <asp:Button runat="server" ID="btJoindreCCTP" cssclass="switchButton" ToolTip="Inverser en cliquant."/>                               
                            </asp:Panel>
                        </header>                       
                        <div id="CCTP_content" Class="container">
                            <asp:panel runat="server" id="cctpList" CssClass="cctpList section">
                                <asp:ListView runat="server" ID="lvCCTP" OnItemCommand="lvCCTP_ItemCommand" DataKeyNames="IdCCTPCompoDCE" >                                   
                                    <LayoutTemplate>
                                        <asp:PlaceHolder id="itemPlaceholder" runat="server">
                                        </asp:PlaceHolder>
                                    </LayoutTemplate>
                                    <ItemTemplate>
                                        <div class="cctpRow">
                                            <h3><asp:Literal runat="server" Text='<%#Eval("Nom") %>'></asp:Literal></h3>
                                            <div class="ori">                                              
                                                <asp:RadioButton ID="ro" runat="server" Text="Original" GroupName="cctpSM1" Checked='<%#Eval("selection") = Francelot.CCTP.CompoSM.TypeCCTP.Original %>' AutoPostBack="true" OnCheckedChanged="ro_CheckedChanged" />
                                                <asp:Button runat="server" ID="btro" cssClass="btn-ico viewDoc" UseSubmitBehavior="False" CommandArgument='<%#Eval("CCTPOriginale.idPieceJointe") %>' CommandName="ViewDocOriginal" />
                                            </div>
                                            <asp:panel ID="pSpe" runat="server" cssclass="spe" Enabled='<%#Eval("CCTPSpecifique.idPieceJointe") > 0 %>'>
                                                <asp:RadioButton ID="rs" runat="server" Text="Spécifique" GroupName="cctpSM1" Checked='<%#Eval("selection") = Francelot.CCTP.CompoSM.TypeCCTP.Specifique %>' AutoPostBack="true" OnCheckedChanged="rs_CheckedChanged" />
                                                <asp:Button runat="server" ID="btrs" cssClass="btn-ico viewDoc" UseSubmitBehavior="False" CommandArgument='<%#Eval("CCTPSpecifique.idPieceJointe") %>' CommandName="ViewDocSpecifique" Visible='<%#Eval("CCTPSpecifique.idPieceJointe") > 0 %>' />
                                            </asp:panel>
                                            <div class="up">
                                                <asp:Button runat="server" ID="btrsUp" cssClass="btn-ico uploadDoc" UseSubmitBehavior="False" CommandArgument='<%#Eval("IdCCTPCompoDCE") %>' CommandName="ViewUpload" />
                                            </div>                                       
                                        </div>
                                    </ItemTemplate>                                  
                                </asp:ListView>
                            </asp:panel>
                            <asp:panel runat="server" ID="pZoneUpload" CssClass="section zupload-collapsed" DefaultButton="btUploadDoc">
                                <div class="depotBloc">
                                    <h5>Zone de dépôt des additifs à la CCTP originale.</h5>
                                    <div>
                                        <telerik:RadAsyncUpload Culture="fr-FR" ID="RAU" runat="server" DropZones=".dropZone" PostbackTriggers="btUploadDoc" MaxFileInputsCount="1" AllowedFileExtensions="doc,docx" data-clientFilter="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" OnClientAdded="OnClientAdded" AutoAddFileInputs="true" HideFileInput="True" RenderMode="Lightweight">     
                                            <Localization  Cancel="Annuler" Remove="Retirer"  DropZone="Déposez le fichier ici" />                                           
                                        </telerik:RadAsyncUpload >                                      
                                        <div class="dropZone" >
                                            <span>Déposez le fichier ici</span>
                                        </div>
                                    </div>
                                    <div class="action-upload">
                                        <asp:Button runat="server" ID="btUploadDoc" UseSubmitBehavior="False" CommandName="UploadDoc" Text="Envoyer" OnClientClick="OnClientClicking()" />
                                    </div>
                                  </div>
                                <asp:Button runat ="server" Text="tempmail" ID="btnmail"/>
                            </asp:Panel>
                        </div>
                    </section>
                    <telerik:RadCodeBlock ID="rcb" runat="server">
                        <script>
                            var uploadctrl = '<%= RAU.ClientID %>';
 
                            function OnClientAdded(sender, args) {
                                var allowedMimeTypes = $telerik.$(sender.get_element()).attr("data-clientFilter");
                                $telerik.$(args.get_row()).find(".ruFileInput").attr("accept", allowedMimeTypes);
                            }
 
                            function OnClientClicking(args) {
 
                                var upload = $find(uploadctrl);
                                var files = upload.getUploadedFiles();
 
                                if (files == 0) {
                                    args.set_cancel(true);
                                }
                            }
                            </script>
                    </telerik:RadCodeBlock>
                </ContentTemplate>
            </telerik:RadWindow>

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Apr 2020, 02:35 PM

Hi Vincent,

I hope you are well and safe at home!

The reported scenario is similar to the one discussed in this forum post

RadAjax with Response.Write to download String into an Excel file.

Also it might be useful to take a look at these additional resources on the matter:

Best Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Ajax
Asked by
Vincent
Top achievements
Rank 1
Iron
Iron
Answers by
Rumen
Telerik team
Share this question
or