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

RadAjaxPanel, problem with PostBack PageRequestManagerParserErrorException

1 Answer 74 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Javier
Top achievements
Rank 1
Javier asked on 04 Jul 2012, 08:30 PM
I'm using several controls on a page that has a radajaxpanel that contains several controls as i will show:
<asp:Content ID="Content1" ContentPlaceHolderID="VSContentPlaceHolder" Runat="Server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" >
</telerik:RadScriptManager>
<telerik:RadCodeBlock ID="EventsRCodBlo" runat="server">      
        <script type="text/javascript">
            window.onload = firstLoad;
 
            function firstLoad() {
                
                setDivHeight();
                //alert(isPostBack());
            }
            function selTreLstChange(sender, args) {
                 
                var treelist = $find("<%=PersonnelAssignedRTreLst.ClientID%>");
                var items = treelist.get_selectedItems();
                var count = items.length;
                if (count > 0) {
                    var item = items[0];
                    var nodetype = item.get_element().getAttribute("typeofnode");
                    var perid = item.get_element().getAttribute("perid");
                    var AuxQualifiedHid = document.getElementById("<%=SelQualHidFie.ClientID%>");
                    AuxQualifiedHid.value = nodetype;
                    var AuxPersAsIDHid = document.getElementById("<%=PersAsIDHidFie.ClientID%>");
                    AuxPersAsIDHid.value = perid;
                    var index = item.get_hierarchicalIndex();
 
                    $find("<%=MainRAjaPan.ClientID %>").ajaxRequest("PersTypeChanged");
                }
            }
            function selBut(sender, args) {
                 
                var toolBar = sender;
                var button = args.get_item();
                var command = button.get_commandName();
                 
                if (command == 'Save') {
                   //Save logic
                }               
            }
            function setDivHeight(sender,args) {
                 //Set height from divs
            }
        </script>
    </telerik:RadCodeBlock>
<telerik:RadToolBar ID="MainToolBar" runat="server" Width="100%" OnClientButtonClicking="selBut" OnButtonClick="MainToolBar_ButtonClick">
            <Items>           
                <telerik:RadToolBarButton runat="server" CommandName="Back" CommandArgument="Back" Text="Back" ImageUrl="~/VS/Images/textbox/post_button_undo.gif" NavigateUrl="javascript:cancel();" ToolTip="Back" PostBack="false" >
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton runat="server" CommandName="Save" CommandArgument="Save" Text="Save Changes" Visible="true" ImageUrl="~/VS/Images/color/16/0040-save.gif" ToolTip="Save Changes" >
                </telerik:RadToolBarButton>  
                <telerik:RadToolBarButton runat="server" CommandName="Add" CommandArgument="Add" Text="Add Per" ImageUrl="" ToolTip="Add" PostBack="true" Visible="true">
                </telerik:RadToolBarButton>
            </Items>
 </telerik:RadToolBar>
<telerik:RadAjaxLoadingPanel ID="MainLoaPan" runat="server"></telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel ID="MainRAjaPan" runat="server" LoadingPanelID="MainLoaPan" ClientEvents-OnResponseEnd="setDivHeight">
 <div id="LeftUDiv" runat="server"
            style="width: 49.5%; height: 100%;
            float:left;
            overflow:hidden;
            border-spacing:inherit;  
            border: 1px solid #aaaaaa;
            background-color:#FFFFFF;">
<div id="LeftU1Div" runat="server"
                style="width: 100%;height: 45%;
                position: relative;
                overflow: auto;
                background-color:#FFFFFF;">
 
                <%--Tasks RadGrid--%>
                <telerik:RadGrid ID="TasksRGriVie" runat="server" AutoGenerateColumns="false" AllowMultiRowSelection="false"
                                        OnSelectedIndexChanged="TasksRGriVie_SelectedIndexChanged" OnPreRender="TasksRGriVie_PreRender"
                                        OnItemDataBound="TasksRGriVie_ItemDataBound">
                    <MasterTableView DataKeyNames="taskID" ClientDataKeyNames="taskID" ShowHeader="false" Width="99%">
                        <Columns>                                                       
                            <telerik:GridBoundColumn DataField="PIBCID" Visible="false" HeaderText="PIBCID" ItemStyle-Font-Size="Smaller"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FVRItemID" Visible="false" HeaderText="FVRItemID" ItemStyle-Font-Size="Smaller"></telerik:GridBoundColumn>                           
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>           
            <div id="LeftU2Div" runat="server"
                style="width: 100%;height: 45%;
                position: relative;
                overflow: auto;
                background-color:#FFFFFF;">
 
                <%--Personnel Assigned RadTreeList --%>                    
                <telerik:RadTreeList ID="PersonnelAssignedRTreLst" runat="server" DataKeyNames="ID" ParentDataKeyNames="parent"
                                        OnNeedDataSource="PersonnelAssignedRTreLst_NeedDataSource" AutoGenerateColumns="false"
                                        AllowMultiItemSelection="false" GridLines="None" ShowTreeLines="false" Width="100%" Height="99%"
                                        OnItemDataBound="PersonnelAssignedRTreLst_ItemDataBound" OnItemCommand="PersonnelAssignedRTreLst_ItemCommand"
                                        OnItemCreated="PersonnelAssignedRTreLst_ItemCreated" OnPreRender="PersonnelAssignedRTreLst_PreRender" >
                    <Columns>
                        <telerik:TreeListBoundColumn DataField="CandidateID" UniqueName="rTreeLstPersAsColCandID" Visible="true" ItemStyle-Font-Size="Smaller">
                        </telerik:TreeListBoundColumn>
                        <telerik:TreeListBoundColumn DataField="Desc" UniqueName="rTreeLstPersAsColName" Visible="true" ItemStyle-Font-Size="Smaller">
                        </telerik:TreeListBoundColumn>
                        <telerik:TreeListBoundColumn DataField="QualDesc" UniqueName="rTreeLstPersAsColExp" Visible="true" ItemStyle-Font-Size="Smaller">
                        </telerik:TreeListBoundColumn>                            
                    </Columns>                        
                    <ClientSettings Selecting-AllowItemSelection="true">
                        <ClientEvents OnItemSelected="selTreLstChange" />
                    </ClientSettings>                             
                </telerik:RadTreeList>  
            </div>
   </div>
<div id="RightUDiv" runat="server"
            style="width: 50%; height: 100%;
            float:right;
            overflow:hidden;                   
            border-spacing:inherit;  
            border: 1px solid #aaaaaa;
            background-color:#FFFFFF;">
                     
            <%--Personnel To Assign RadGrid --%>
            <telerik:RadGrid ID="PersonnelToAssignRGriVie" runat="server" AutoGenerateColumns="false"
                             AllowMultiRowSelection="false"
                             OnPreRender="PersonnelToAssignRGriVie_PreRender" AllowSorting="true"
                             OnSortCommand="PersonnelToAssignRGriVie_SortCommand"
                             OnItemDataBound="PersonnelToAssignRGriVie_ItemDataBound">
                <MasterTableView DataKeyNames="ID,UniqueID" ClientDataKeyNames="ID" TableLayout="Auto" Width="100%">
                    <NoRecordsTemplate>
                        No Records to display
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="Selectcol" HeaderStyle-Width="100px" ItemStyle-Width="80px">
                            <HeaderTemplate>
                                <telerik:RadButton ID="PersonnelAddRBtn" CommandName="PersonnelAddRBtn" CommandArgument="PersonnelAddRBtn"
                                                   runat="server" Text='' Visible="true" Width="95px" >
                                </telerik:RadButton>                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Image ID="imgTrain" ToolTip="Requires Training" runat="server" Visible="false" ImageUrl="~/VS/Images/icon_emark1.gif" Width="10" Height="10" onclick="openTrainingInfo(this);" />
                                <asp:CheckBox ID="chkSelPersonnel" runat="server" Visible="true" onclick="checkSpan(this);" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="CandidateID" AllowSorting="true" HeaderText="Candidate ID" UniqueName="CandidateIDCol" SortExpression="CandidateID" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Desc" AllowSorting="true" HeaderText="Name" UniqueName="NameCol" SortExpression="Desc" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CompName" AllowSorting="true" HeaderText="Company" UniqueName="CompNameCol" SortExpression="CompName" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="QualDesc" AllowSorting="true" HeaderText="Qualified" UniqueName="QualDescCol" SortExpression="QualDesc" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <SortingSettings EnableSkinSortStyles="false" />
                <ClientSettings>
                    <Selecting AllowRowSelect="false" />
                    <Resizing AllowColumnResize="false" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
                </ClientSettings>
            </telerik:RadGrid>
 
        </div>
</telerik:RadAjaxPanel>

The way of working is the next, when selecting a item from TaskRadGridView, we load data from the database:
Protected Sub TasksRGriVie_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim AuxTaskId As Integer
        If TasksRGriVie.SelectedItems.Count > 0 Then
            Dim item As GridDataItem = TasksRGriVie.SelectedItems(0)
            AuxTaskId = CInt(item.GetDataKeyValue("taskID"))          
            LoadTaskDetails(AuxTaskId)
        End If
    End Sub
 
Sub LoadTaskDetails(ByVal selTaskID As Integer)
        If TasksRGriVie.Items.Count > 0 Then
 
            Dim auxQual As Integer = CInt(Me.SelQualHidFie.Value)
           
            Dim curContractor As Integer = Session("CompanyID")
 
            Dim objtask As OQCrewItem = listTask.Find(Function(c) c.taskID = selTaskID)
            
            'Loads the list view with the current personnal
             Dim ListPerAs As New List(Of OQCrewPersonnel)
             'Getting data from the view state
             If selTaskID > 0 Then
                  'listTask a property that gets data from viewState('listtask')
                  ListPerAs = listTask.Find(Function(c) c.taskID = selTaskID).personnel
                  PersonnelAssignedRTreLst.DataSource = ListPerAs.Where(Function(c) c.statusID = 1).OrderByDescending(Function(c) c.lastName).ToList()
        End If
 
            'Gets list of personnel
            Dim listAvailablePer = OQProjectBL.GetAvailableCrewPersonnel()           
            
           Dim list = listAvailablePer.Where(Function(c) c.qualified = "Yes").OrderBy(Function(c1) c1.lastName).ToList()         
            PersonnelToAssignRGriVie.DataSource = list
            PersonnelToAssignRGriVie.DataBind()
        End If
    End Sub
The when we select (highlight) a node from the RadTreeList PersonnelAssignedRTreLst, we get the data for PersonnelToAssignGriView, from the PersonnelToAssignGriView we can select (check) several items then when we click on the button PersonnelAddRBtn 
on the header of this item we should add those items to PersonnelAssignedRTreLst, the problem occurs when the list of items related to the PersonnelToAssignGriView  is like 500 rows, there is a problem when click on the PersonnelAddRBtn 
Button from the header, it does not make a postback I get this error. Uncaught Sys.WebForms.PageRequestManagerParserErrorException: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. It doesn't make a postback, I search in the web, I'm not using Response.write  anywhere. Thinking that the problem could be that the button is inside the radajaxpanel i set a button Add on the RadToolBar, but i get a similar error, it never goes to the function established on the serverside, i set a debugger on the JS function selBut that executes onClientButtonClicking event, then i got an exception on telerik code on line 6224 see that on image related.
There is another odd behavior of the page, in some computers there isn't any exception, could be a configuration that i'm missing?.

Javier

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 09 Jul 2012, 02:47 PM
Hello Javier,

The error message and the behavior you described is a generic problem and the reason for it cannot be found without debugging. Can you give us access to the problematic page and instruction how to replicate the error? We might also need to get runnable version of it so we can debug it locally.

Kind regards,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Ajax
Asked by
Javier
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or