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.
Asked
Active
Viewed 331 times
-2
-
Do you have a question? – Splendor Jun 24 '13 at 15:17
-
Yeah, why it´s happening that? – TheGman Jun 24 '13 at 16:12
-
You need to provide some more details, we can not guess what is wrong. Please show us the code that is giving you trouble. – tacaswell Jun 25 '13 at 00:37
1 Answers
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