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

  • Home
  • SEARCH
  • 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 7912903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:43:07+00:00 2026-06-03T13:43:07+00:00

I have a asp.net MVC3 web application in which i search for a certain

  • 0

I have a asp.net MVC3 web application in which i search for a certain criteria and display the search results in a grid, on click of the row in the grid i load the results in a new page. Meanwhile when i click on the row in the table i am displaying a loading image on the top of the table. I am displaying spinner on row selection.

function onRowSelected(e) {
    var grid = $(this).data('tGrid');
   // populate some data here
    $("#spinner").show();
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "/Search/GetResults",
        data: populate the data to be sent,
        dataType: "text json",
        success:
        function (data, textStatus) {
            if (data != "Success") {
                ShowError(data);
            }
            else {
                window.location.href = "/Search/Test/";
               }
        },
        error:
        function (XMLHttpRequest, textStatus, errorThrown) {
            alert("Error Occured!");

        }

    });
}

and the code for spinner is:

<div id='spinner' style='display:none;'><center><img alt='' src='../../Images/loading.gif' title='Loading...' /><b>Loading...</b></center> </div>

My problem is, when the user selects one row and when the loading symbol is displayed, He is able to click on another row. I want to prevent the user from clicking or selecting anything on the page once the loading spinner is visible. Any help

UPDATE:

My problem is not with the loading image position.. i want it to display as an overlay or something of that sort so that the page behind will be grayed out and user can’t select anything

  • 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-06-03T13:43:08+00:00Added an answer on June 3, 2026 at 1:43 pm

    You can define a javascript variable, say bool_spinner, which is by default false but set to true when the spinner is shown, and gets set back to false after the data is loaded.

    You can then test this variable inside your functions (like inside onRowSelected) to control what happens depending on the spinner’s state.

    Then you can maybe use something like this (untested) to prevent other active HTML elements, (like links and form submit buttons) from reacting when you click on the page:

    $("body").click(function(e) {
        if (bool_spinner) e.preventDefault();
    }
    

    EDIT: You can also check exactly what has been clicked if you need to, like this:

      var target = $(e.target);  
      if (target.is("#tGrid")) {
          etc.        
      }
    

    UPDATE: Actually, you don’t even need to set a new script variable, you can just directly test the state of your spinner:

    if ($('#spinner').is(':hidden')) { 
      etc. 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is about asp.net mvc3 web application. We have used Object cache to store
I have a web application which was using Asp.net MVC2 . I Upgraded it
I have an ASP.NET MVC 3 (Razor) Web Application, with a particular page which
I have an ASP.NET MVC 3 / .NET Web Application, which is heavily data-driven,
I have an ASP.NET MVC3 web application with UI, Business (entities), and Data (DbContext)
In ASP.NET MVC 3 web application I have a viewmodel with properties which marked
I have an ASP.Net MVC3 web application written in C#. I have one ActionResult
I have an Asp.Net MVC3 web applications, which uses Areas. When I run it
I have created blank Asp.Net-MVC 3 web application and want to write my own
I am writing a web application on Asp.Net MVC 3. Assume that we have

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.