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

  • SEARCH
  • Home
  • 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 8862595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:45:57+00:00 2026-06-14T15:45:57+00:00

I am currently developing a .net mvc 3 application. Here is the problem. For

  • 0

I am currently developing a .net mvc 3 application. Here is the problem. For some reason, Though I am using Ajax.BeginForm and the right action is getting called, after the action completes, it is trying to redirect as if to another page that does not exist. However, I want it to stay on the same page just submit the form using ajax and return some friendly message to the user after the action completes.

Here is my Ajax.BeginForm page:

@using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { HttpMethod = "Post" }))
{
    <div id="lnkContainer"><a href="#" onclick="javascript:document.forms[0].submit(); return false;">Update</a>&nbsp;</div>
    @Html.TextAreaFor(m => m.Message, new { style = "width:575px" })
}

Here is my Action:

[Authorize]
[AcceptVerbs(HttpVerbs.Post)]
public PartialViewResult Action(ActionModel actionModel)
{
database-related code
.....
database-related code

return PartialView(); 
}
  • 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-14T15:45:58+00:00Added an answer on June 14, 2026 at 3:45 pm

    I’m fairly certain your problem lies in onclick="javascript:document.forms[0].submit();". This will submit the form as a normal POST request. If you want to use the @Ajax.BeginForm helper, use a regular <input type="submit"> to trigger the submit. If you really need to use a link, then using @Ajax.BeginForm really doesn’t matter because you will have to code submitting an Ajax request using jQuery, etc.

    As far as Ajax.BeginForm and redirection is concerned, the form will revert to a normal HTML form in the event that the user has disabled javascript in their browser, or if your missing the appropriate scripts, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing an MVC application in ASP.net. I am using AJAX.ActionLink to
I am currently developing an events calendar application using ASP.NET MVC and SQL Server
We are developing an ASP.NET MVC Application that currently uses it's own database ApplicationData
I am currently developing a site using ASP.NET MVC 3, I am using Nhibernate.
We are currently building the framework for developing a C# .net application using visual
I'm currently developing an ASP.NET MVC application with a ton of PK-FK relationships in
I am developing an application using ASP.NET MVC 1 and VS2008. When I deploy
I am currently developing an ASP.NET MVC 3 site using Visual Studio 2010 with
We are currently developing a web application in ASP.NET MVC which would really benefit
Currently in the early stages of developing a very large project using ASP.Net 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.