I spend almost whole day to find solution for this problem. I have no idea how to fix this.

This is my view:

```
<div id="Opis"></div>

<script>
    $(document).ready(function() {
        var idwyc = 2;
        $.getJSON('@Url.Action("Test","Pracownik_biurowy")',{ selectedWycieczka: idwyc } , function (data) {

            $('#Opis').append(data)
        });
    });
</script>

```

and method in Pracownik\_biurowyController:

```
public ActionResult Test(int selectedWycieczka)
{

    var wycieczkaDetails =
       db.Wycieczka_fakultatywna.Where(w => w.Id_wycieczki == selectedWycieczka).Select(x => new
       {

           x.Opis,
           x.Koszt
       });

    return Json(wycieczkaDetails,JsonRequestBehavior.AllowGet);
}   

```

I think it should work but I get all the time error.

> 
> The parameters dictionary contains a null entry for parameter
>  'selectedWycieczka' of non-nullable type 'System.Int32' for method
>  'System.Web.Mvc.ActionResult Test(Int32)' in
>  'BiuroPrototyp.Controllers.Pracownik\_biurowyController'. An optional
>  parameter must be a reference type, a nullable type, or be declared as
>  an optional parameter. Nazwa parametru: parameters
> 
> 
> 

RouteConfig:

```
  routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

```