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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:40:01+00:00 2026-05-20T03:40:01+00:00

this might be an easy question but for me right now it is not

  • 0

this might be an easy question but for me right now it is not clear and I have to get things sorted in my head… maybe somebody can help me with that =)…

I know that MVC comes with Ajax Helpers.
I know there is Microsoft library and there is also jquery.
I know that with MVC 3 they introduced unobtrusive javascript which adds some special tags to html for cleannes…

but how does ist play together?

Example: I want to post a remote form (partial view) per ajax to add comments to a blog post. without posting the whole page back.

in my Partial View would I use Ajax.BeginForm() is this then MvcAjax or Jquery?
Or would I use Html.BeginForm() and register something like $.post on the click event of the Form. This would also have a fallback of plain html if javascript is disabled or not supported….

Or in general when to use what for posting comments to a blog post?… and I assume that it is correct, that I am posting to the create action of the commentscontroller and I would use the JsonModelBinder to transform it to a model. After that I would return Json and would append it to my comments list…

Is this reasonable why of doing it?

  • 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-20T03:40:01+00:00Added an answer on May 20, 2026 at 3:40 am

    Ajax.BeginForm() is this then MvcAjax or Jquery?

    By default it is jquery. You need to reference the jquery.unobtrusive-ajax.js script for this to work.

    Or would I use Html.BeginForm() and register something like $.post on the click event of the Form.

    That’s an alternative. Personally that’s what I do.

    I assume that it is correct, that I am posting to the create action of the commentscontroller and I would use the JsonModelBinder to transform it to a model. After that I would return Json and would append it to my comments list…

    The JsonModelBinder has been introduced in ASP.NET MVC 3 and it allows you to send a JSON string to a controller action which will be mapped back to a view model. For example if you have the following view model:

    public class PersonViewModel
    {
        public string Name { get; set; }
        public int Age { get; set; }
    }
    

    and the following action:

    public ActionResult Foo(PersonViewModel person) 
    {
        ...    
    }
    

    the traditional way to invoke it in AJAX is:

    $.ajax({
        url: '@Url.Action("foo")',
        type: 'POST',
        data: { name: 'john', age: 20 },
        success: function(result) {
            // TODO:
        }
    });
    

    and in ASP.NET MVC 3 you could send a JSON as request parameter which will be bound to the PersonViewModel action parameter:

    $.ajax({
        url: '@Url.Action("foo")',
        type: 'POST',
        contentType: 'application/json',
        data: JSON.stringify({ name: 'john', age: 20 }),
        success: function(result) {
            // TODO:
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this might be an easy question but i have a notification that when clicked
this question might be easy but i'm not sure how to do it. i
i know this question might be too easy, but i have no idea how
This might seem an easy question for some, but I am struggling with it.
This might be an easy one, but I'm not really experienced with sql. I
This might be an easy question, but I cannot figure out why the compiler
I'm a newbie with PHP so this might be ridiculously easy question, but despite
This might be a really easy question but I would like to grab the
I realize this might be an easy question that I may have overlooked in
This might seem very easy, but here is my question,what is the opposite of

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.