-2

I´m making a site using MVC 3 and razor engine. I have a WebGrid that has a ViewModel as it´s source that it´s not updating. Weird thing is that it only updates when I recompile the project, and I wanted to update it with an ajax call or at the very least with a page refresh.

TheGman
  • 1
  • 4

1 Answers1

0

I solved it but I don't know why it didn't work with the first solution I came up with. I had a static method in my ViewModel that retuned the list of Viewmodel objects that the webgrid used as it's model. It queried from two different databases and populated the Viewmodel objects.

I had to move that method to the controller and use the Viewmodel objects just as containers for the data to be passed to the webgrid and it worked.

TheGman
  • 1
  • 4