Passing value from view-model page to code-behind page


I am using the design pattern shown in the NS javascript groceries tutorial. In this file you create the code that is called by

In the i notice that it return values but they are not available in at any time. I want to out put the actual reason for not logging in that comes from the server and not use a generic message as seen in that example. How do I do that?

for example line 29 on here does a return but it is not available in line 29 here Kinda seem similar to issues in jquery returning data in a asynchronous call?