Click here to Skip to main content
15,890,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /Operation/null


What I have tried:

$('.save').on('click', function (e) {
       var tr = $(this).parents('tr:first');
       var NewID = tr.find("#newID").html();
        e.preventDefault();
       if (NewID != "") {
           var DataObjectForAjaxCall = { strBooking: NewID };
           $.ajax({
               url: "@Url.Action("invoicePrint", "Return", new { area = "Operation" })",
               method: "GET",
               data: DataObjectForAjaxCall,
               cache: false,
               async: false,
               success: function (Result) {
                   alert(Result);
                   var w = window.open($(this).parent().data("url"));
                   $(w.document.body).html(Result);
               }
           });
       }
       else {
           msgAlerts(Result);
       }
   });


Controller
public ActionResult invoiceShipment(string strBooking)
       {
           if (strBooking != "")
           {
               int Intid = Convert.ToInt32(strBooking) - 120000000;
               BookShipmet objBS = new BookShipmet();
               objBS = new BL_Operation().GetShipmentByID(Intid);
               return PartialView("~/Areas/Operation/Views/Shared/Return/_invoicePrint.cshtml", objBS);
           }
           else
           {
               return RedirectToAction("Index", "TimeOutError");
           }
           //return View();
       }
Posted
Updated 17-Apr-18 11:23am

1 solution

Your InvoiceShipment method in the controller is expecting a value in strBooking, you are not passing one. Either send in a value or change your parameter to allow null values. If you allow null values then you better handle it in your code as well or it will error.

Allowing nulls will be like this(add the question mark after the variable type):

public ActionResult invoiceShipment(string? strBooking)
 
Share this answer
 
Comments
Member 10028394 20-Apr-18 15:14pm    
it work fine on the line gevin below
objBS = new BL_Operation().GetShipmentByID(Intid);
and go to return partial view
return PartialView("~/Areas/Operation/Views/Shared/Return/_invoicePrint.cshtml", objBS);
on partial view it show error instead of show result

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900