PageRequestManagerServerErrorException: Value cannot be null

4 posts, 1 answers
  1. Igor
    Igor avatar
    10 posts
    Member since:
    Oct 2013

    Posted 16 Dec 2013 Link to this post

            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'				
  2. Answer
    msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 16 Dec 2013 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Igor
    Igor avatar
    10 posts
    Member since:
    Oct 2013

    Posted 17 Dec 2013 Link to this post

    Thank you msigman, you are right. It was the bug in my code :)
  5. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 17 Dec 2013 Link to this post

    Glad to hear it. Please click the Mark as Answer button so future searchers can see the correct answer. Thanks!
Back to Top