I have a button that users can click to bid on something. Each bid, broadcasts the latest bid to every other client. That s the reason why I m using SignalR.
Now, the user needs to have active credits, and if he doesn t have credits I want to redirect him somewhere.
The more obvious approach fails me, so any suggestion is welcome.
//Does the user have credits to spend?
if (user.LanceCreditBalance >= 1)
{
//populate the "ar" object and send it out to everybody.
var result = Json.Encode(ar);
Clients.addMessage(result);
}
else
{
//And this isn t working as expected. Doesn t redirect
//And causes a 302 error when viewing the Firebug console in Firefox.
HttpContext.Current.Response.Redirect(@"http://www.google.com");
}
The above code is all within the Chat class which inherits from the SignalR.Hub class.