Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6599877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:32:55+00:00 2026-05-25T18:32:55+00:00

Ok, I know there are already questions on here about this but none are

  • 0

Ok, I know there are already questions on here about this but none are giving me an answer.

I’m using jqgrid in MVC. In my View I have set up a jqgrid:

jQuery(document).ready(function () {
            var invoiceId = @Model.Invoice.InvoiceId;
            jQuery("#list").jqGrid({
            url: '/Invoice/InvoiceLineGridData/' + invoiceId,

....
            editurl: '/Invoice/SaveInvoiceLine/' + invoiceId,

...
        });

So my jqgrid is a list of invoiceLines that relate to an invoice. The edit works fine but when I try to do an add I get error Status: ‘error’. Error code: 500.

The method it’s calling on the controller is like:

public void SaveInvoiceLine(InvoiceLine invoiceLine, int id)
        {
            ...
        }

So what’s causing the error on the add is it’s trying to assign a null to id. I don’t want to make the id nullable because it never will (should) be.

I’ve found the issue isn’t with: var invoiceId = @Model.Invoice.InvoiceId;

as I for an experiment changed to editurl: '/Invoice/SaveInvoiceLine/2',

Even with this hardcoded on add I’m still getting the error with it coming through nullable.

Any suggestions on how to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:32:55+00:00Added an answer on May 25, 2026 at 6:32 pm

    This did it:

    http://blog.palelocust.com/?p=52

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there are a lot of questions on here about this, but most
I know there are plenty of questions here already about this topic (I've read
I know there are dozens of questions that ask about this error, but none
There's already a question on this here. But i want to know if its
I know there are already many questions like mine but I found no answer
I know there are already some posts about this topic, but I cannot find
I know there are already several similar questions here, but I need some recommendations
I know there are a lot of questions on this topic already, but it
I know there are similar questions about this topic,but somehow I'm not able to
I know, there are already a lot of similar questions here but I did

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.