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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:01:46+00:00 2026-06-18T09:01:46+00:00

I have just started a new project in MVC4 using some code from an

  • 0

I have just started a new project in MVC4 using some code from an existing MVC3 project. I can force my form to ajax reload the specific DIV, but not using the normal submit method, only with the test doSomthing() javascript function. What am I missing?

To clarify: The first button does not work right, the second one does – but I don’t want to do it that way.

VIEW

@using (Ajax.BeginForm("Method1", null,
new AjaxOptions { HttpMethod = "post", UpdateTargetId = "divPartial1" },
new { id = "form1" }))
{
    <div class="data">
        @Html.LabelFor(x => x.TotalSubmitted, new { @class = "total" })<div class="number total">@Html.FormatValue(Model.TotalSubmitted, "{0:n0}")</div>
        ...
    </div>
    <div class="details">
        <div id="divPartial1">
            @Html.Partial("ReportDashboardAppPartial")
        </div>
    </div>
    <div style="text-align: center;">
        <button type="submit" class="k-button"><span class="k-icon k-i-search" /></button>
        <button type="button" name="Save" value="Save" onclick="doSomething(); return false;"><span class="k-icon k-i-search" /></button>
    </div>
}
<script type="text/javascript">
    function doSomething() {
        $.ajax({
            url: '@Url.Action("Method1", "Controller")',
        type: 'post',
        data: $('form#form1').serialize(),
        success: function (result) {
            $('#divPartial1').html(result);
        }
    });
}
</script>

_Layout

@model BaseViewModel
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    <link href="@Url.Content("~/Content/kendo.compatibility.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2012.3.1114/kendo.common.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2012.3.1114/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2012.3.1114/kendo.default.min.css")" rel="stylesheet" type="text/css" />
    @RenderSection("styles", false)
    <script src="@Url.Content("~/Scripts/kendo/2012.3.1114/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.3.1114/kendo.all.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.3.1114/kendo.aspnetmvc.min.js")"></script>
    @RenderSection("scripts", false)
</head>
<body>
    @Html.Partial("_AlertWindow")
    <div id="wrapper">
        <header>
            <div id="logindisplay">
                @Html.Partial("_LoginPartial")
            </div>
            <a href="@Url.Action("Index", "Home")">
                <div id="logo"></div>
            </a>
            <div id="title">
                <h1>Ha!</h1>
            </div>
            @(Html.Kendo().Menu().Name("Menu").BindTo("Main").SecurityTrimming(true))
        </header>
        <div id="main">
            @RenderBody()
        </div>
        <footer>
            <div id="version">@Html.ActionLink("Version " + @Model.CurrentVersion, "About", "Home")</div>
        </footer>
    </div>
    @RenderSection("end_scripts", false)
</body>
</html>

I know this should work.

  • 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-18T09:01:48+00:00Added an answer on June 18, 2026 at 9:01 am

    I had the same problem. The solution is to add a statement in _Layout.cshtml page.

    @Scripts.Render(“~/bundles/jqueryval”)

    The definition of ScriptBundle(“~/bundles/jqueryval”) as below

    bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                "~/Scripts/jquery.unobtrusive*",
                "~/Scripts/jquery.validate*"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started a new project, and I am using the Delphi 2009
I JUST started a new XCode Project. The code I have added in so
I have just started a new project using a Linq to Sql model and
I have just started a new database project to price customer bid proposals: Some
I just started working on a new project with a ton of existing code,
I'm new to using Linq and just started a side project to learn some
we have just started using a git account of our Django website project so
I have just started a new project and am looking to use the SplitViewNavigator
I have just started a new Xcode project for the first time since downloading
I have just started with ruby on rails, have made a new rails project

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.