Skip to content
Advertisement

Knockout dropdownlist databind is not working in ajax call

I try to bind a dropdownlist in knockout with MVC 4. Here is my code:

Action

JavaScript

Knockout.js

JavaScript

Html

JavaScript

But the GetUserTypes action is not fired.

And there is another error show in the Firebug.

enter image description here

Advertisement

Answer

Your action GetUserTypes doesn’t expected any parameters, but you pass viewModel object:

JavaScript

Try to remove this property from ajax call.

About error in FireBug, just include jQuery script in your page.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement