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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:12:48+00:00 2026-06-02T04:12:48+00:00

When i click the submit button, i directly go to my action. Following 2

  • 0

When i click the submit button, i directly go to my action. Following 2 are not happening:

  1. My client side beginForm method is not invoked at this time. Which i want.
  2. Request.IsAjaxRequest is false even though my model has the form input

Trying to find an answer for this problem. The same code works in MVC2, so i must be missing some thing here.

Following 2 MS js files are referenced:

<!-- MS AJAX -->
<script type="text/javascript" src="/Scripts/MicrosoftAjax.js"></script>
<script type="text/javascript" src="/Scripts/MicrosoftMvcAjax.js"></script>

Form Code:

@{
        using (Ajax.BeginForm(ActionNames.Index, ControllerNames.CustomerSearch, new {Area = ""}, new AjaxOptions
                                                                                                      {
                                                                                                          HttpMethod = "Post",
                                                                                                          OnBegin = "CustomerSearch.beginForm",
                                                                                                          OnSuccess = "CustomerSearch.successForm"
                                                                                                      }, new {id = "CustomerSearchForm"}))
        {

... form items ...
}
}

Form as it displays on the page:

<form action="/CustomerSearch" data-ajax="true" data-ajax-begin="CustomerSearch.beginForm" data-ajax-method="Post" data-ajax-success="CustomerSearch.successForm" id="CustomerSearchForm" method="post">

... Other Form Items ...
<input type="image" src="/App_Themes/Main/Images/ResponseAction/Buttons/btn_submit.gif" alt="Submit" id="SubmitButton" />
</form>

And here is my CustomerSearch.js, on page load alert(2) shows just fine:

var CustomerSearch = {
    enums: {
        buttonId: "SubmitButton",
        searchResultsContainerId: "CustomerSearchResults"
    },
    beginForm: function () {
        alert(1);
        var $button = $("#" + CustomerSearch.enums.buttonId);
        jMessage("Processing request...", $button, true, false);
        return true;
    },
    successForm: function (context) {
        var $button = $("#" + CustomerSearch.enums.buttonId);
        var $searchResults = $("#" + CustomerSearch.enums.searchResultsContainerId);
        var data = context.get_data();

        jMessageHide();
        $searchResults.html(data).fadeIn(500);
    }
};

alert(2);

My unobtrusive javascript enabled is set to true in web.config:

<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
  • 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-02T04:12:50+00:00Added an answer on June 2, 2026 at 4:12 am

    With MVC3 the unobtrusive Ajax helpers:

    • Ajax.ActionLink
    • Ajax.RouteLink
    • Ajax.BeginForm
    • Ajax.BeginRouteForm

    are using the jquery.unobtrusive.ajax.js file.

    So you need to include that js file instead of the MicrosoftAjax ones
    (MicrosoftAjax files are deprecated in MVC3 and not shipped with MVC4 beta):

    <script type="text/javascript" src="/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code does not submit the input values: $('.button').live('click', function() { var date
I have a page like this: <form class=ajax method=post action=add_item.php> [text input] [submit button]
every time I click submit button there's a black 1px border around it. How
I have a website where I have to click a submit button on a
I have a submit button when i click on that button i am having
I click on items in my listbox and then hit a submit button, but
I have a form which I want to submit upon button click which is
Is there ASP button that won't submit post form data. Whenever I click an
If the user manually clicks the 'submit' button, i use this code: if (isset($_POST['submit_findall']))
Hi how can we get checkbox checked status when I click submit button with

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.