Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6557323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:03:34+00:00 2026-05-25T13:03:34+00:00

I have a button that users can click to bid on something. Each bid,

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:03:35+00:00Added an answer on May 25, 2026 at 1:03 pm

    Server:

    if(user.LanceCreditBalance >= 1)
    {
        var result = Json.Encode(ar);
        // send Message to all clients
        Clients.addMessage(result);
    }
    else
    {
        // Invoke a js-Function only on the current client
        Caller.redirectMe("http://www.google.com");
    }
    

    Client:

    $(function () {
        var chat = $.connection.chat;
    
        chat.addMessage = function(message) {
            // do something
        };
    
        // function the server can invoke
        chat.redirectMe = function(target) {
            window.location = target;
        };
    
        $.connection.hub.start();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web page that displays comments, and users can click a 'Flag'
I have two forms, one with a radio button that users must select to
Suppose, I want to have a link or a button that when user click
There is one form i have and a user can click on preview button
I have a tableLayoutPanel with either 5 or 7 columns. Users can click show/hide
I have an app where users can select an Excel file, that excel file
I have a .jsp page that users can enter information and then save it
I have a input field where users can write a domain name that they
I have created a button CSS class that uses background images with different positions
I have a submit button that changes when the user hovers his mouse over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.