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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:26:42+00:00 2026-05-23T13:26:42+00:00

I have 2 different type of user When I log in, I am submitting

  • 0

I have 2 different type of user

When I log in, I am submitting my page to account/logon

Depending up of the type of user I am redirecting to (using RedirectToAction) to

Teacher/index
Or
Student/index.

The action Student/index is a simple one and returns its view immediately.

But the action Teacher/index is having immense data access and the view will be returned only after one minute. (I will optimize the data access don’t worry abbot it because it not a part of this post)

During the one minute I want to show “loading” message in browser.

How can I do this?

I have Jquery and MVC2

  • 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-23T13:26:42+00:00Added an answer on May 23, 2026 at 1:26 pm

    One possibility is to split this action into two: one that will render a simple view and one which will do the heavylifting and render a partial. So when a teacher logs in you would redirect to the first action and render a simple HTML view containing a spinner. Then you would trigger an AJAX call to the second action to do the data access, inject the partial into the DOM and hide the progress.

    So you could put something like this into the view:

    <img id="progress" src="progress.gif" alt="" />
    <div id="result" data-url="<%= Url.Action("TeacherData") %>"></div>
    

    and then in a separate js file trigger the AJAX call:

    $(function() {
        $.ajax({
            url: $('#result').data('url'),
            type: 'POST',
            complete: function() {
                $('#progress').hide();
            },
            success: function(result) {
                $('#result').html(result);
            }
            error: function() {
                alert('oops');
            }
        });
    });
    

    and on your controller:

    public ActionResult Teacher()
    {
        return View();
    }
    
    [HttpPost]
    public ActionResult TeacherData()
    {
        var model = ... do the heavy data access
        return PartialView(model);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my registration page, I have radio button to select user type, competitor or
I have an array of different type objects and I use a BinaryWriter to
I have a C++ template class that gets instantiated with 3 different type parameters.
I'm working on a SaaS application where each customer will have different configurations depending
different programming languages have different features or lack certain features. Design patterns are a
You can have different naming convention for class members, static objects, global objects, and
Windows Mobile devices have different behaviour for suspending when the device is on battery
I have noticed over the years that different developers have different criteria for what
When I have two mysql servers that have different jobs (holding different databases) but
Since I'm sure many people have different standard, I've made this post a community

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.