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

Script Timeout

4 Answers 713 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kurt Kluth
Top achievements
Rank 1
Kurt Kluth asked on 22 Apr 2013, 04:05 PM

Currently have a rad grid that will load fine in development but once it is moved into production receive a script timeout error.   In Production, the first load of the page works but have a RadComboBox that allows for Autopostback that changes the results in my RadGrid.  It is at this point that I receive the timeout.  Each time in production it will timeout after 30 seconds and have not figured out a way to stop it from timing out.  I have compared the values with IIS to compare script timeouts and they are the same.  It is trying to process 19,000 records, which I know it may take some time to query but in development the query doesn't take long at all to complete.

Following code is in web.config

<httpRuntime maxRequestLength="612353" executionTimeout="600"/>

Code found in ASPX page as I seen this suggested by others.

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server"
    AsyncPostBackTimeout="600"></telerik:RadScriptManager>

Also added the following to my code and did not affect the outcome:

ValidateRequest="false"


In an attempt to resolve the problem I changed how my RadGrid would receive the data from client-side to code-behind where I could specify the command timeout and this has only caused the page to load for 5 seconds and not even return indications of and error.  Just not update my RadGrid, though it will change a information box that was created.

Looking for suggestions that might help in resolving this error. 

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 25 Apr 2013, 01:48 PM
Hi Kurt,

This issue does not seem to be caused by request time out, according to the error message. Could you please try disabling AJAX just to see whether there is not an issue with the connection to the database. There are a few results in google containing the same error message and all of them are related to database connection expiration time. For your convenience I have found this blog post and I believe that it will be of help.

All the best,
Pavlina
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.
0
Kurt Kluth
Top achievements
Rank 1
answered on 25 Apr 2013, 03:11 PM

Can you instruct me how to disable AJAX with my radGrid?  I disable it when a user would like to export the results to Excel or CSV.

 

function onRequestStart(sender, args) {
    if (args.get_eventTarget().indexOf("ExportToCsvButton") >= 0
        || args.get_eventTarget().indexOf("ExportToExcelButton") >= 0)
 
        args.set_enableAjax(false);
}

 

Here is the code that I have implemented but it will not load in our development environment but will load in Production.  It still doesn't update the grid accordingly.  Also included is the message I get in development.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
 
Source Error:
 
 
Line 126:
Line 127:    Private Sub RadGrid4_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.DataBound
Line 128:        gdreader.Close()
Line 129:        oConn.Close()
Line 130:    End Sub 'RadGrid1_DataBound

Private Sub RadGrid1_NeedDataSource(ByVal [source] As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
     RadGrid1.DataSource = ReadRecords()
 End Sub 'RadGrid1_NeedDataSource
 
 Private Function ReadRecords() As SqlDataReader
     oConn.Open()
     Dim ocmd As New SqlCommand("sp_seMarketEmailList", oConn)
     ocmd.CommandType = CommandType.StoredProcedure
     With ocmd.Parameters
         .Add(New SqlParameter("@PotentialType", radPotentialType.SelectedValue.ToString))
     End With
     ocmd.CommandTimeout = 360
     gdreader = ocmd.ExecuteReader()
 
     Return gdreader
 End Function 'ReadRecords
 
 Private Sub RadGrid4_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.DataBound
     gdreader.Close()
     oConn.Close()
 End Sub 'RadGrid1_DataBound
0
Pavlina
Telerik team
answered on 30 Apr 2013, 08:38 AM
Hello,

To disable ajax you should set EnableAJAX property of used Telerik RadAjax control (RadAjaxManager / RadAjaxPanel) to false.

Kind regards,
Pavlina
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.
0
Kurt Kluth
Top achievements
Rank 1
answered on 02 May 2013, 12:47 PM
Thank you for your reply.  I tried disabling AJAX on it and it didn't help.  Ended up solving the problem by making a change to the stored procedure and everything works properly now.
Tags
Grid
Asked by
Kurt Kluth
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Kurt Kluth
Top achievements
Rank 1
Share this question
or