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 8916393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:13:56+00:00 2026-06-15T05:13:56+00:00

I have a Razor/ASP/MVC3 web application with a form and a Submit button, which

  • 0

I have a Razor/ASP/MVC3 web application with a form and a Submit button, which results in some action on the server and then posts back to the form. There is often some delay, and it’s important that users know they should wait for it to complete and confirm before closing the page or doing other things on the site, because it seems users are doing that and sometimes their work has not been processed when they assume it has.

So, I added a “Saving, Please Wait…” spinner in a hidden Div that becomes visible when they press the Submit button, which works very nicely, but I haven’t been able to find a way to get the Div re-hidden when the action is complete.

My spinner Div is:

<div id="hahuloading" runat="server">
  <div id="hahuloadingcontent">
    <p id="hahuloadingspinner">
        Saving, Please Wait...<br />
        <img src="../../Content/Images/progSpin.gif" />
    </p>
  </div>
</div>

Its CSS is:

#hahuloading
{
    display:none;
    background:rgba(255,255,255,0.8);
    z-index:1000;
}

I get the “please wait” spinner to appear in a JS method for the visible button, which calls the actual submit button like this:

    $(document).ready(function () {
        $("#submitVisibleButton").click(function () {
            $(this).prop('disabled', true);
            $("#myUserMessage").html("Saving...");
            $("#myUserMessage").show();
            $("#hahuloading").show();
            document.getElementById("submitHiddenButton").click();
        });
    });

And my view model code gets called, does things, and returns a string which sets the usermessage content which shows up fine, but when I tried doing some code in examples I saw such as:

        // Re-hide the spinner:
        Response.write (hahuloading.Attributes.Add("style", "visibility:hiddden"));

It tells me “hahuloading does not exist in the current context”.
Is there some way I am supposed to define a variable in the view model which will correspond to the Div in a way that I can set its visibility back from the server’s action handler?
Or, can I make the div display conditional on some value, in a way that will work when the page returns from the action?
Or, in any way, could anyone help me figure out how to get my div re-hidden after the server action completes?

Thanks!

  • 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-15T05:13:57+00:00Added an answer on June 15, 2026 at 5:13 am

    Is this done with ajax? I would assume so because the page is not being redirected. Try this:

    $(document).ready(function () {
        $("#submitVisibleButton").click(function () {
            $(this).prop('disabled', true);
            $("#myUserMessage").html("Saving...");
            $("#myUserMessage").show();
            $("#hahuloading").show();
            document.getElementById("submitHiddenButton").click();
        });
        $("#hahuloading").ajaxStop(function () {
         $(this).hide();
        });
    });
    

    As an aside, you no longer need runat=server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC3 web application with C# and Razor. Through a form
I have an ASP.NET MVC 3 (Razor) Web Application, with a particular page which
I am developing an ASP.Net MVC 3 Web application using Razor Views. I have
I have a action link on my MVC3 razor view. Which have a action
I have built an ASP.NET MVC 3 web application (with exlusively Razor/cshtml pages) that
I have a Razor view in my asp.net MVC3 application with a dropdownlist like
I have an ASP.NET MVC3 in C# and Razor. The architecture of the application
I have an ASP.NET MVC3 application in C# and Razor. In the view MyView
I have an ASP.NET MVC3 in C# and Razor. The architecture of the application
I have online form builder appplication in ASP.NET MVC3 with Razor views. It is

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.