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

PageRequestManagerServerErrorException: Value cannot be null

3 Answers 553 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 16 Dec 2013, 01:35 PM
        function GetExternalData(userId) {
            var parameters = "GetExternalData," + userId;
            try {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(parameters);
            } catch (e) {
 
            }
        }
	
When I call ajaxRequest method of RadAjaxManager I get a strange error:

'error': 'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Value cannot be null. Parameter name: key'				

3 Answers, 1 is accepted

Sort by
0
Accepted
msigman
Top achievements
Rank 2
answered on 16 Dec 2013, 09:12 PM

Hi Igor,

Try setting EnableAjax="false" on the RadAjaxManager for debugging.  This should allow you to see where the underlying error is happening.  Oftentimes the "Value cannot be null: Parameter name ____" is caused by a LINQ-to-SQL or LINQ-to-Entities call that has some bad data.  Specifically, it can happen when LINQ expects a field to be non-null, but the data coming from the database has a null value.  Let me know if that helps.

0
Igor
Top achievements
Rank 1
answered on 17 Dec 2013, 06:51 AM
Thank you msigman, you are right. It was the bug in my code :)
0
msigman
Top achievements
Rank 2
answered on 17 Dec 2013, 01:55 PM
Glad to hear it. Please click the Mark as Answer button so future searchers can see the correct answer. Thanks!
Tags
Ajax
Asked by
Igor
Top achievements
Rank 1
Answers by
msigman
Top achievements
Rank 2
Igor
Top achievements
Rank 1
Share this question
or