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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:43:20+00:00 2026-05-13T19:43:20+00:00

When I submit form using button it works fine (renders PartialView in the menuload

  • 0

When I submit form using button it works fine (renders PartialView in the menuload div):

<% using (Ajax.BeginForm("Menu", null, new AjaxOptions { UpdateTargetId = "menuload", HttpMethod = "POST", LoadingElementId = "status-waiting" }, new { @id = "menuFormControl", enctype = "multipart/form-data"}))
                   { %> 
<input id="menuFormControlsubmit" type="submit" value="submit" ) />
                 <%  } %> 

But I want to do it using javascript, to load page parts. I try this:

<% using (Ajax.BeginForm("Menu", null, new AjaxOptions { UpdateTargetId = "menuload", HttpMethod = "POST", LoadingElementId = "status-waiting" }, new { @id = "menuFormControl", enctype = "multipart/form-data"})){  } %>  

                   <script language="javascript" type="text/javascript">
                       $("#menuFormControl").submit();                       
                    </script>

But it renders my PartialView on a whole page.
The code of the controller:

public ActionResult Menu()
        {
            return PartialView("~/Views/Shared/MenuUserControl.ascx");
        }
  • 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-13T19:43:21+00:00Added an answer on May 13, 2026 at 7:43 pm

    When you call

    $("#menuFormControl").submit();
    

    you are making the form be POSTed just like it would if you had used a traditional form (instead of an AJAX form). You will have to post the content of the form to the server using AJAX and insert the response.
    Try something like

     $.ajax({
      type: 'POST',
      url: '<%= Url.Action("Menu", "MyMenuController") %>',
      data: $("#menuFormControl").serialize(),
      success: function(){ $("#menuFormControl").html(data); /* This will insert the HTML returned from the server */ }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 515k
  • Answers 515k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I figured it out, so I'll post for anyone else… May 16, 2026 at 6:26 pm
  • Editorial Team
    Editorial Team added an answer I can't think of any serious drawbacks to that. It… May 16, 2026 at 6:26 pm
  • Editorial Team
    Editorial Team added an answer Update your repository to the head with the revision that… May 16, 2026 at 6:26 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to use link to submit a form using the following code:
Using the AngularJS framework, how do I have the Submit button both update the
The full story is I want to disable the submit button on a form's
Here's the test page I'm using. This version works fine, forwarding to #success: <!DOCTYPE
What happens is that I'm able to add and delete records from form using
I've 2 asp listbox controls and an html input button, and using js i
I am creating a multipage form in PHP, using a session. The $stage variable
I am having a little trouble figuring out how to disable the submit button
I created login from that when clicking submit button sends variables to login_success.php page.but
The first submit works as expected, but the next time it's fully posted back.

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.