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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:59:44+00:00 2026-06-10T04:59:44+00:00

I do ajax post on my mvc app when dropdown change. $(function () {

  • 0

I do ajax post on my mvc app when dropdown change.

$(function () {
    $('#meters').change(function () {
        var analizor_id = $(this).val();
        if (analizor_id && analizor_id != '') {
            $.ajax({
                url: '@Url.Action("AnalizorInfoPartial", "Enerji")',
                type: 'GET',
                cache: false,
                data: { analizor_id: analizor_id },
                success: function (result) {
                    $('#TableAnalizorInfo').html(result);
                }
            });
        }
    });
});

DropDown

@Html.DropDownList("sno", new SelectList(Model, "sno", "AnalizorAdi"), "-- Analizör Seçiniz --", new { id = "meters" })

Can I show a loading image or anything else during ajax process? (between begin – finish event) and Code example?

EDIT

Can I use like this?

success: function (result) {
    $('#TableAnalizorInfo').html(result);
}
begin:function(){ 
    //show image
}
complete:function(){ 
    //hide image
}

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-10T04:59:45+00:00Added an answer on June 10, 2026 at 4:59 am

    Of course, the events you are looking for are beforeSend and complete:

    if (analizor_id && analizor_id != '') {
         $.ajax({
             url: '@Url.Action("AnalizorInfoPartial", "Enerji")',
             type: 'GET',
             cache: false,
             beforeSend: function() {
                 // Show your spinner
             }, 
             complete: function() {
                 // Hide your spinner
             },
             data: { analizor_id: analizor_id },
             success: function (result) {
                $('#TableAnalizorInfo').html(result);
            }
        });
    }
    

    or you could do it globally for all AJAX requests on the page using global AJAX event handlers:

    $(document).ajaxSend(function() {
        // Show your spinner
    }).ajaxComplete(function() {
        // Hide your spinner
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a jQuery AJAX post like this: var form = $(#formid); form.submit(function() {
How to pass multiple checkboxes using jQuery ajax post this is the ajax function
For some time I am worknig in MVC, I learnt from this post, http://evolpin.wordpress.com/2011/04/12/asp-net-mvc-partialview-with-ajax/#comment-435
I am tring to use an ajax post to an action. GET requests work
I have this MVC form with 2 dropdownlist where selection on the first dropdown
I use jquery to post to an MVC controller action that returns a table
I am doing an ajax Post action and i need to work out the
I am performing an Ajax submit ASP.Net with MVC : @using (Ajax.BeginForm( action, References,
I've got a nice MVC app running now, and I'm adding some AJax functionality.
I've used a jQuery ajax post on a form generated from a MSAjax MVC

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.