We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Value cannot be null. Parameter name: input

Thread ID:

Created:

Updated:

Platform:

Replies:

113853 Oct 12,2013 06:08 PM UTC Oct 17,2013 07:18 AM UTC ASP.NET MVC (Classic) 4
loading
Tags: Grid
Jeremy Branham
Asked On October 12, 2013 06:08 PM UTC

I am getting this error after the object is saved -
Value cannot be null. Parameter name: input
 
I am using a generic controller and repository pattern to save the object.
I have verified the collection is not null and contains an item before being passed to the GridActions method.
 
This works fine if I am not using GridEditMode.DialogTemplate for the edit mode.

 

        public virtual ActionResult Save(T theObject)
        {
            var existingObject = Repo.GetByMultipleValues(primaryKeys(theObject));

               
            if (existingObject == null)
            // It must be an insert operation
            {
                Repo.Save(theObject);
            }
            else
            // It must be an update operation
            // Update the existing entity with the new values
            {
                AutoMapper.Mapper.Map(theObject, existingObject);
                Repo.Save(existingObject);
            }
            return GetAllItems().GridActions<T>();
        }

 


Jeremy Branham
Replied On October 12, 2013 06:11 PM UTC

Stack Trace -
 
[ArgumentNullException: Value cannot be null.
Parameter name: input]
   System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +531395
   System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input) +9
   Syncfusion.Mvc.Grid.GridAction`1.ExecuteGridResult(ControllerContext context) +1176
   Syncfusion.Mvc.Grid.GridActionResultBase`1.ExecuteResult(ControllerContext context) +57
   Syncfusion.Mvc.Grid.GridHtmlActionResult`1.ExecuteResult(ControllerContext context) +38
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +89
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9630364
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Hariharan J V [Syncfusion]
Replied On October 14, 2013 09:23 AM UTC

Hi Jeremy Branham,

 

Thanks for using Syncfusion products.

 

We suggest you to return partialview for the BeginEdit and BeginAddNew request type in the server mode(DialogTemplate). Please refer the below code snippets.

 

[HomeController.cs]

[AcceptVerbs(HttpVerbs.Post)]

        public ActionResult Index(PagingParams args, int? OrderID)

        {                 

            RequestType currentRequest = (RequestType)Convert.ToInt32(args.RequestType);

            if (currentRequest == RequestType.BeginEdit)

            {

            EditableOrder ord = (EditableOrder)OrderRepository.Select(OrderID);

            return PartialView("OrderEditorTemplate", ord);

            }

            else if (currentRequest == RequestType.BeginAddNew )

            {

            return PartialView("OrderEditorTemplate", new EditableOrder());

            }

            else

            {

                IEnumerable data = OrderRepository.GetAllRecords();

                return data.GridActions<EditableOrder>();

            }

        }

 

For your convenience, we have prepared a simple sample to demonstrate this and the same can be downloaded from the below link.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/DialogTemplate666937353.zip

 

Please let us know if you need any further assistance.

 

Regards,

Hariharan J.V.


Jeremy Branham
Replied On October 16, 2013 03:58 AM UTC

I am returning a partial view in my Index() method.
The error occurs when returning the GridActions() in the Save() method.

Alan Sangeeth S [Syncfusion]
Replied On October 17, 2013 07:18 AM UTC

Hi Jeremy,

Thank You for using Syncfusion Product.

We regret for the inconvenience caused. We are unable to reproduce the issue in our end. The previous sample which we had provided you is running without any error in Save Action and we have created a video demonstration of it. So could you please try to reproduce the issue in our sample and send us back or send your sample so that we can provide you a better solution?

Please find the attached video below.

Please let us know if you need further assistance.

Regards,

Alan Sangeeth S

 



SaveAction_a83e6a06.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;