Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SignalR and 500 Errors
  2. public bool AddThing(Thing thing)
  3. {
  4.     // add and notify client
  5. }
  6.  
  7. public class Thing {
  8.     public Double Foo { get; set; }
  9. }
  10.        
  11. {"hub":"ThingHub","method":"AddThing","args":[{"Foo":"bar"}],"state":{},"id":1}
  12.        
  13. $.connection.hub.error(function() {
  14.     console.log('An error occurred...');
  15. });
  16.        
  17. public bool AddThing(Thing thing)
  18. {
  19.     return true;
  20. }
  21.  
  22. public class Thing
  23. {
  24.     public Double Foo { get; set; }
  25. }
  26.        
  27. myHub.addThing({"Foo":"Bar"});
  28.        
  29. myHub.someMethod()
  30.      .done(function(result) {
  31.      })
  32.      .fail(function(error) {
  33.      });