I see a few problems with your code...
1.
The controller name probably
Main
and not
MainController
(it's true that the class implementing the controller called
MainController
, but the controller named
Main
only) - check it!
2.
data: { name: selectedItem }
I cant see where name variable declared, and I think you meant to call the varable 'name', so put it in quotes!
data: { 'name': selectedItem }