Last post Sep 12, 2012 09:10 AM by graham123
Sep 11, 2012 11:01 AM|graham123|LINK
I have created an SPA using MVC4. The application asks a set of questions (one set of questions per c# model), and is able to operate whilst offline.
I can ask the same questions again and again whilst offline, and upshot / knockout keeps hold of these until the application comes back online again.
I have a problem though. The way I have told upshot / knockout where to call back for the submit is to ask it to do an initial get (which returns an empty ienumerable of my models) at the start of the process. This works fine unless the application happens
to be offline at this point. If the application is offline, I do not see an error - however, failing to call this initially makes it so that upshot / knockout does not post back any changes made.
I have 2 questions - an answer to either will solve my problem.
1/ How can I detect whether the initial call to get the empty ienumerable of models failed?
2/ How else can I let upshot / knockout know where to submit? This would actualy be preferable to (1) as it would be one less trip to the server. However, I have been playing with this for a few days and have been so far unable to get this to work.
Sep 12, 2012 05:52 AM|TimoYang|LINK
Share ur solution, plzzzzzzzzzzzzzzzzzzzzz……for ur state is marked
Sep 12, 2012 09:10 AM|graham123|LINK
I managed to get around this by calling the get on the initial page load. If the application is offline, the page won't load, so I don't need to worry about it any more.
New problem is how to determine whether the changes have been submitted successfully (so that I can warn the user they need to connect before leaving the site)