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

Error=Object reference not set to an instance of an object. at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)

5 Answers 420 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Suresh
Top achievements
Rank 1
Suresh asked on 15 Apr 2015, 11:27 AM

HI All,Telerik rad grid has been using my application and it is enabled filtering/sorting and paging. Everything is working fine.But intermittently, grid is displaying empty when page index change or sorting on header of the grid. My observations, it is not hitting page load event also at serverside. I believe Telerik rad grid is using some asynch call from clientside and causing the issue intermittently. if it is hitting page load it must be captured in try catch block.I don't have any client side event handling and rad ajax on the page.

Please help to resolve the issue.

It is intermittent and annoying a lot for sorting and page number click events.

 

------------------------------------------------------------------------- 

Error code - 98b3fc9c-e2e2-80be-6086-19431aa1a018 at  ExecutedRequests
10:50 AM

 

Application error when access
/_layouts/15/Tesla.SHP.Adhoc.Web/ExecutedRequests.aspx, Error=Object reference
not set to an instance of an object.   at
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String
eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
98b3fc9c-e2e2-80be-6086-19431aa1a018

04/14/2015 10:49:22.13 w3wp.exe
(0x0314)              
         0x0300  SharePoint
Foundation        
        Runtime                      
               
tkau      
Unexpected       System.NullReferenceException:
Object reference not set to an instance of an object.    at
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String
eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
98b3fc9c-e2e2-80be-6086-19431aa1a018

04/14/2015 10:49:22.14 w3wp.exe
(0x0314)                      
0x0300  SharePoint Foundation        
       
General                      
               
ajlz0       High      
Getting Error Message for Exception System.Web.HttpUnhandledException
(0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown.
---> System.NullReferenceException: Object reference not set to an instance
of an object.     at
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String
eventArgument)     at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)     at
System.Web.UI.Page.HandleError(Exception e)     at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)     at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)     at
System.Web.UI.Page.ProcessRequest()     at
System.Web.UI.Page.Process...               
98b3fc9c-e2e2-80be-6086-19431aa1a018

04/14/2015
10:49:22.14*              
w3wp.exe (0x0314)

5 Answers, 1 is accepted

Sort by
0
Suresh
Top achievements
Rank 1
answered on 15 Apr 2015, 11:32 AM

 

 Here I am posting my entire radrid code for reference

                  <telerik:RadGrid runat="server" ID="RadGridRequests" AllowFilteringByColumn="true" AllowCustomPaging="true" OnInit="RadGridRequests_Init" 
                       OnPageIndexChanged="RadGridRequests_PageIndexChanged" OnPageSizeChanged="RadGridRequests_PageSizeChanged" EnableLinqExpressions="false"  AllowSorting="true" PagerStyle-AlwaysVisible="true" 
                        OnSortCommand="RadGridRequests_SortCommand"  OnItemCommand="onItemCmd">
                        <GroupingSettings CaseSensitive="false" />
                      <FilterMenu OnClientItemClicking="clientItemClicking"></FilterMenu>
                        <MasterTableView AutoGenerateColumns="False" AllowFilteringByColumn="True" AllowPaging="true"  EnableLinqGrouping="false">
                            <SortExpressions>
                                <telerik:GridSortExpression FieldName="ExecutionOn" SortOrder="Descending" />
                            </SortExpressions>
                            <Columns>
                                 <telerik:GridHyperLinkColumn DataTextFormatString="{0}" FilterDelay="2000" 
                                    HeaderText="Pickup No." UniqueName="ShipmentLabel" SortExpression="ShipmentLabel" DataNavigateUrlFormatString="/Departments/SupplyChain/Logistics/_layouts/15/Tesla.SHP.Adhoc.Web/RequestDetails.aspx?Id={0}&Source=AER"  DataNavigateUrlFields="ShipmentRequestFormID" 
                                     ItemStyle-Font-Underline="true" DataTextField="ShipmentLabel" ShowFilterIcon="true" FilterControlWidth="85%">
                                </telerik:GridHyperLinkColumn>
                                <telerik:GridBoundColumn FilterDelay="2000"  ShowFilterIcon="true" UniqueName="Requestor" SortExpression="Requestor"  DataField="Requestor" HeaderText="Requestor"  FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true"  UniqueName="Created" SortExpression="Created"   DataField="Created"  AllowSorting="true"  HeaderText="Creation Date" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true"  UniqueName="ExecutionOn"  SortExpression="ExecutionOn"   DataField="ExecutionOn" DataFormatString="{0:G}" HeaderText="Execution Date" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true"  SortExpression="ReadyDate"   DataField="ReadyDate" DataFormatString="{0:G}"  HeaderText="Ready date/time" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true"  SortExpression="DeliveryDate"  DataField="DeliveryDate" DataFormatString="{0:G}"  HeaderText="Need by date/time" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="OriginAddressLine1" HeaderText="Origin" AllowSorting="false" AllowFiltering="true" HeaderStyle-CssClass="org" ItemStyle-CssClass="org" FilterControlWidth="80%">                                
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="DestinationAddressLine1" HeaderText="Destination" AllowSorting="false" AllowFiltering="true" HeaderStyle-CssClass="des" ItemStyle-CssClass="des" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="OriginSupplier" HeaderText="Ship From" AllowSorting="false" AllowFiltering="true" HeaderStyle-CssClass="org" ItemStyle-CssClass="org" FilterControlWidth="80%">                                
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="DestinationSupplier" HeaderText="Ship To" AllowSorting="false" AllowFiltering="true" HeaderStyle-CssClass="des" ItemStyle-CssClass="des" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="TotalWeight" HeaderText="Total Weight" AllowSorting="false" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="packages" HeaderText="# packages" AllowSorting="false" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true"  SortExpression="Status"  DataField="Status" HeaderText="Status" AllowSorting="true" AllowFiltering="true" >
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="Coordinator" HeaderText="Coordinator" SortExpression="Coordinator" AllowSorting="true" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="CarrierName" SortExpression="CarrierName" HeaderText="Carrier" AllowSorting="true" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" SortExpression="TrackingNumber" DataField="TrackingNumber" HeaderText="Tracking #" AllowSorting="false" AllowFiltering="true" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true" DataField="CommercialInvoice" HeaderText="Commercial Invoice #"  AllowSorting="false" FilterControlWidth="80%">
                                </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterDelay="2000" ShowFilterIcon="true"  SortExpression="International"  DataField="International" HeaderText="International" AllowSorting="true" AllowFiltering="true" FilterControlWidth="60%" HeaderStyle-Width="10%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ShipmentRequestFormID" HeaderText="Id" Display="false">

                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>

                    </telerik:RadGrid>

0
Suresh
Top achievements
Rank 1
answered on 15 Apr 2015, 04:50 PM
Telerik team, Could you please help it out...Very critical to catch up intermittent issue.
0
Marin
Telerik team
answered on 16 Apr 2015, 11:29 AM
Hello,

I checked the grid declaration and the error information you posted and it looks more like a general kind of error not directly related to the control.
With your setup the grid should not perform any kind of ajax request or client-side callbacks. What is strange here is that the Page_Load event should fire in all cases, even if there was ajax request.

The error in your case seems to originate from the RaisePostBackEvent handler, which should also fire after the server-side Page_Load event. You can verify this by handling the RaisePostBackEvent of the page:
protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument)
    {
        //check the values of sourceControl and eventArgument should not be null
        base.RaisePostBackEvent(sourceControl, eventArgument);
    }

The most likely reason for the exception in this case is that any of the arguments in the above method is null. It is not clear what might be the cause of the exception but it seems to be related to the ASP.NET framework and Sharepoint rather than some specific code in the grid.

To further troubleshoot the issue you can check any server-side code or additional markup on the page that is likely to cause problems during postback. Another option is to try to isolate the issue in an as simple page as possible (containing just grid with dummy data) and see if the same problem is still replicated there.

The fact that the issue does not happen regularly on each postback again leads to the conclusion that is more of environment related problem rather (for some reason the ASP.NET does not pass a valid argument to the RaisePostbackEvent method) some problem in the grid's code.

You can further troubleshoot to see if the problem occurs under certain circumstances or specific setup that causes the exception.

From the exception details it seems you are running a Sharepoint Foundation edition which has a limited set of features and may cause problems in some more complex scenarios. It might be a good idea to check if the same issue is replicated on the full Sharepoint Server version.

I hope the above suggestions help. Let me know if you have any other questions.

Kind Regards,
Marin
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Suresh
Top achievements
Rank 1
answered on 17 Apr 2015, 03:10 AM

Hello Marin,

 Thanks for reply and it is very descriptive.

 As issue concerns, RaisePostBackEvent is stating  for Telerik.web.UI...Name space i don't see the cause to happen it in ASP.net or share point framework.

Anyway's, as per your suggestion, I will try to incorporate Raisepostbackevent for page and see.

More over, we are handling filtering/Sorting and paging through SQL for that we are using custom paging option with GRID. at a time we will bring only 10/20/50 records based page size and retrieving virtual count property of the grid to hack page count/numbers.

As described earlier post, the event is not hitting server (pageload) it is returning from browser it self and it is very quick when this error is occurring, and it is likely to happen after few click on pagenumbers/sorting (once per average 10 clicks). and error is occurring only in higher environments (stage and production), dev environment working very smooth with out any issues.

 

Please help if this additional information help to narrow down actual cause of the error.

 

Thanks for your time.

 

0
Marin
Telerik team
answered on 17 Apr 2015, 08:13 AM
Hello,

If the issue is replicated only on certain environments then you can check if there are any differences in the Sharepoint and IIS setup and configuration that can possibly cause such problems.
For example you can verify that both Dev and Production environment use the same IIS version and setup, the same browser version, the same Sharepoint version and configuration in the web.config file and the same .NEt version as well as the same Telerik assembly version.

The RaisePostbackEvent is called by the ASP.NET framework, the problem is that mostly likely one of the arguments is coming as null (instead of the actual control that caused postback). We do not have control over what parameters are passed to this method, because it is internally called by the framework, that's why I suggested that the issue not related to the Telerik code. The exception indeed originates there but the actual issue is that the framework is passing null argument to the method (instead of a valid value)
You can verify the same by handling the RaisePostbackEvent method on the page.

Again, exceptions replicated only in certain environments are most likely due to the setup in this environment rather than code in the project itself.

Regards,
Marin
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Suresh
Top achievements
Rank 1
Answers by
Suresh
Top achievements
Rank 1
Marin
Telerik team
Share this question
or