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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:16:28+00:00 2026-05-25T10:16:28+00:00

Ok..i want to redirect a user after the validation check using $.AJAX to a

  • 0

Ok..i want to redirect a user after the validation check using $.AJAX to a peritcular view… how do i do that ? .. pleae help…

here is my $.AJAX code… EX: i want user redirected to “/Home/Movies” controller action…

if not logged in stay on the same page…

<script type="text/javascript">
    $('#btnLogin').click(function () {
        var email = $('#Email').val();
        var Password = $('#Password').val();
        var postdata =
        {
            "Email": email,
            "Password": Password
        };

        $('.Loading').fadeIn(50);
        $.ajax({
            url: '@Url.Action("CheckLogin","Home")',
            data: postdata,
            success: function (msg) {
                var data = msg.split(':');
                $('#Result').html(data[0]);
                $('.Loading').fadeOut(50);
             },
            error: function (data) {

                $('#Result').html(data);
                $('.Loading').fadeOut(50);
            }
        });
    });
</script>

here is my controller action which is used for checking Login details…

 public ContentResult CheckLogin(Users checkuser)
        {
            if (db.CheckUserLoginDetails(checkuser.Email, checkuser.Password))
            {
                return Content("Login Successful:" + checkuser.Email);
            }
            else
            {
                return Content("Login UnSuccessful");
            }
        }

also how can i pass a returned results from this view to another view.. in this exmaple if the user is logged in i want to show his email id on the redirected page which is lets say “/home/Movies”

thx in advance

  • 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-25T10:16:29+00:00Added an answer on May 25, 2026 at 10:16 am

    Show your loading image before ajax request, and hide on success or error handlers.

    add <div class="loading">Loading...</div> to your markup

    $('.loading').fadeIn(50);
    $.ajax({
        url: '@Url.Action("CheckLogin","Home")',
        data: postdata,
        success: function (msg) {
            $('#Result').html(msg);
            $('.loading').fadeOut(50);
        },
        error: function (data) {
            $('#Result').html(msg);
            $('.loading').fadeOut(50);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You know that if you want to redirect a user in PHP you can
After a user creates an account on my website, I want to redirect the
Now I want to automatic redirect to facebook application's index page after user installing
I use Ruby On Rails and devise gem. I want redirect user after registration,
I want to redirect all requests for index.html|php|php5 to http://www.domain.co.uk/ using mod_rewrite and I've
I want to redirect my controller methods, so that I can submit a form
I want to redirect output in such a way that works for output generated
I want to redirect adm folder to administrator my .htaccess code: Redirect 301 /adm
I want to redirect users from a certain page after 10 minutes, and as
So, I want to preserve a specific session variable after the user logs out.

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.