RadAjaxPanel

6 posts, 0 answers
  1. David S
    David S avatar
    11 posts
    Member since:
    May 2008

    Posted 29 May 2008 Link to this post

    I currently have a Gridview with checkboxes in each row and there is a button below the grid to export the checked items as a self-extracting *.exe file.  This functionality was working fine...

    I utilized the functionality in the 'First Look' example for my Gridview so whenever the paging buttons were used, the Loading image would appear etc.  When I clicked the 'Export' button was clicked the grid would show the Loading image until the server request was finished and the following error would be displayed:

    Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.  Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

    I have attached my code from the aspx page for further inspection.

    <body> 
        <form id="form1" runat="server"
        <div> 
            <cmis:CaseFilter ID="cfSearch" runat="server" /> 
            <br /> 
         </div>        
     
         <div class="module" style="float:left;">     
                    <pp:ObjectContainerDataSource ID="CrownBriefDataSource" runat="server" DataObjectTypeName="Ontario.Justice.CMIS.Business.Entities.CrownBrief" OnSelecting="DocumentsDataSource_Selecting" UsingServerPaging="true" /> 
                    <telerik:RadAjaxPanel ID="Radajaxpanel1" runat="server" LoadingPanelID="LoadingPanel2" ClientEvents-OnRequestStart="OnRequestStart" ClientEvents-OnResponseEnd="OnResponseEnd"
                        <asp:Panel ID="Panel1" runat="server" Wrap="False" Width="516px"/> 
                        <br /> 
                        Select: <asp:LinkButton ID="CheckAll" runat="server" Text="All" OnClick="CheckAll_click" CssClass="SelectedItem" />
                        <asp:LinkButton ID="UncheckAll" runat="server" Text="None" OnClick="UncheckAll_click" CssClass="SelectedItem" /> 
     
                        <asp:GridView ID="GridViewExport" 
                                runat="server" 
                                AllowPaging="true" 
                                EnableViewState="True"                   
                                AutoGenerateColumns="false" 
                                DataSourceID="CrownBriefDataSource" 
                                EmptyDataText="There are no records that match your search criteria." 
                                DataKeyNames="DocumentNumber" 
                                PageSize="11" 
                                OnDataBound="GridViewExport_DataBound" 
                                Width="90%" 
                                OnPageIndexChanging="GridViewExport_OnPageIndexChanging"
                            <Columns> 
                                <asp:TemplateField HeaderText="Select"
                                    <ItemTemplate> 
                                       <asp:CheckBox ID="chkSelect" runat="server" /> 
                                    </ItemTemplate> 
                                    <HeaderTemplate></HeaderTemplate
                                </asp:TemplateField> 
                                 
                                <asp:TemplateField HeaderText="Type"
                                    <ItemStyle HorizontalAlign="Center" /> 
                                    <HeaderStyle HorizontalAlign="Center"/> 
                                    <ItemTemplate> 
                                        <class="info" href="#"><asp:image ImageAlign="Middle" runat="server" ImageUrl='<%# "~/images/" + GetStatusIcon(DataBinder.Eval(Container.DataItem, "ItemType").ToString())%>' id="imgStatus"></asp:image><span><%# GetApplication(Convert.ToInt32(Eval("Application")))%></span></a> 
                                    </ItemTemplate> 
                                </asp:TemplateField>                          
                                 
                                 <asp:BoundField HeaderText="Last edited on" DataField="LastEditedDate" DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="False" /> 
     
                                <asp:TemplateField HeaderText="Name"
                                    <ItemStyle Width="350" /> 
                                    <HeaderStyle HorizontalAlign="Left"  Width="350" /> 
                                    <ItemTemplate> 
                                        <asp:LinkButton ID="SelectCase" CssClass="SelectedItem" runat="server" CommandArgument='<%# Eval("DocumentNumber") %>' OnClick="SelectFolder_Click" Text='<%# Eval("DocumentName") %>' Enabled='<%# IsDocument(DataBinder.Eval(Container.DataItem, "ItemType").ToString())%>'  />  
                                    </ItemTemplate> 
                                </asp:TemplateField> 
     
                                <asp:BoundField HeaderText="Doc #" DataField="DocumentNumber"/> 
                                <asp:BoundField HeaderText="Jurisdiction" DataField="Jurisdiction_ID" /> 
                                <asp:BoundField HeaderText="Police Service"  DataField="PoliceService"/> 
                                <asp:BoundField HeaderText="Police Case ID" DataField="PoliceCaseId" /> 
                                 
                           
                            </Columns> 
                              
                        </asp:GridView> 
                        <asp:Button ID="btnExport" runat="server" Text="Export" CssClass="exportCase" OnClick="btnExport_Click" /> 
                    </telerik:RadAjaxPanel>    
               </div> 
               <telerik:RadAjaxLoadingPanel ID="LoadingPanel2" runat="server" Transparency="30" BackColor="#E0E0E0"
                        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading6.gif") %>' style="margin-top: 40px;" /> 
                </telerik:RadAjaxLoadingPanel> 
        </form> 
    </body> 

    Thanks,
    David
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 30 May 2008 Link to this post

    Hello David,

    Exporting trough ajax is not possible - you can check this link for more info:
    http://www.telerik.com/community/code-library/submission/b311D-ttcbe.aspx

    Best wishes,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David S
    David S avatar
    11 posts
    Member since:
    May 2008

    Posted 30 May 2008 Link to this post

    Hello Vlad,

    Thank you for the quick reply however, I might have not been clear enough in my initial description.  I am not exporting the contents of the grid.  I am exporting documents associated with the meta-data of the grid.  So, when a row is checked, the documentId is used to retrieve the correct document from the repository.  This part is working fine with ajax.  However, when the document(s) are to be posted for download that's when the problem occurs. 

    The documents are compiled as a self extracting executable file using another 3rd party software.  I will attach my function that compiles them.  Hopefully this will provide more insight as to what the problem is.

            public void ExportClicked(string mappedBinPath, string mappedImagePath) 
            { 
                ArrayList getFilesToProcess2 = new ArrayList(); 
                getFilesToProcess2 = GetFilesToProcess(); 
     
                if (getFilesToProcess2 == null
                { 
                    return
                } 
     
                // We want the client-side to recognize the upcoming file as a zip file. 
                _view.PageResponse.ContentType = "application/exe"
                _view.PageResponse.AddHeader("Content-Disposition""attachment; filename=CMIS.exe"); 
            
                //XceedSfxPrefix sfx = new XceedSfxPrefix(new DiskFile(@"C:\Projects\Ontario.Justice\CMIS\trunk\lib\xcdsfx32.bin")); 
                XceedSfxPrefix sfx = new XceedSfxPrefix(new DiskFile(mappedBinPath + "xcdsfx32.bin")); 
     
                sfx.DialogStrings[DialogStrings.Title] = "Crown Managment Information System Extraction utility"
                sfx.DialogMessages[DialogMessages.Introduction] = "Crown Managment Information System Extraction utility. Please click 'Continue' to proceed extracting case files to your computer."
                sfx.DefaultDestinationFolder = @"C:\"
                sfx.ExistingFileBehavior = ExistingFileBehavior.OverwriteAlways; 
                Icon ico = new Icon(mappedImagePath + "ontario.ico"); 
                sfx.Icon = ico; 
     
                // We will zip directly in the response stream. The temporary compressed 
                // data will be written to the ZipArchive's TempFolder, thus the MemoryFolder  
                // we set in Application_Start. 
                ZipArchive destination = new ZipArchive(new StreamFile(_view.PageResponse.OutputStream)); 
                destination.BeginUpdate(); 
                getFilesToProcess2.Sort(); 
     
                ArrayList refineProcessList = RefineProcessList(getFilesToProcess2); 
     
                foreach (int file in refineProcessList) 
                { 
                    AddFolderAndFiles(dmConnection.DmDocumentSecurityToken, dmConnection.DmLibraryName, file, destination, ""new ArrayList()); 
                } 
     
                destination.SfxPrefix = sfx; 
                destination.DefaultCompressionMethod = Xceed.Compression.CompressionMethod.Deflated; 
                destination.EndUpdate(); 
     
                // And finally we zip in a single operation. If we had to zip more than 
                // one source, we could have used ZipArchive.BeginUpdate/EndUpdate. 
                ArrayList nameFilters = new ArrayList(); 
     
                _view.PageResponse.End(); 
            } 

  5. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 04 Jun 2008 Link to this post

    hi :)


    I'm new to ajax and  some times I got the following exception  sys.webForms.PageRequestManagerParserErrorException:The message recived from the server could not be parsed. on updating the UpdatePanel.
    Can you try using Microsoft UpdatePanel instead of RadAjaxPanel and let me know whether your project works


    Regards...
    <John:Peel />
  6. David S
    David S avatar
    11 posts
    Member since:
    May 2008

    Posted 04 Jun 2008 Link to this post

    After doing some searching, there appears to be an issue with downloading files in ajax.  I was not able to find anything in the Telerik forums, any ideas?

    Thanks,
    David
  7. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 04 Jun 2008 Link to this post

    hi


    Actually, you can't achieve it with updatepanel or RadAjaxPanel. Because download file will response to the client that can't be implemented with updatepanel or radajaxpanel. When you click the download button, you can popup a new page to achieve downloading function, rather than use updatepanel which is not working for you.


    <John:Peel />
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017