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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:59:15+00:00 2026-05-25T05:59:15+00:00

I submit a form to my ASP.NET MVC 3 server through a JavaScript handler

  • 0

I submit a form to my ASP.NET MVC 3 server through a JavaScript handler (I use jQuery), and receive error responses from the server in another JavaScript handler. What I’m wondering is how I should display error messages, resulting from the form submission, in the view? I would prefer using some standard ASP.NET MVC 3 idiom/construct.

EDIT

Note that I want to display error messages from the server, received in a JavaScript error handler function.

  • 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-25T05:59:16+00:00Added an answer on May 25, 2026 at 5:59 am

    You can go the pure MVC way: http://www.asp.net/mvc/tutorials/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript

    Scroll down to “Enabling Client-Side Validation.”

    In your View you’ll have code that looks like this:

    @Html.TextBoxFor(model => model.UserName)
    @Html.ValidationMessageFor(model => model.UserName)
    

    UPDATE

    Seems OP is interested in custom messaging. There isn’t any MVC construct for this sort of custom messaging. Your best bet is to just create your own messaging area and write messages to it in your callback function. Shouldn’t be too complicated!

    $.ajax(..., function(data) {
        $('#errors').append('<p>' + data + '</p>');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to handle dynamically generated form submit in asp.net mvc? Form is dynamically created
First time using Asp.net-mvc and originally followed the NerdDinner tutorial. My form submit button
I have a form within an ASP.NET MVC application and I'm trying to submit
I am just trying to learn how to use JQuery AJAX with ASP.NET MVC
I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC
I am using asp.net mvc 3 jquery validate unobstructive javascript. I am trying to
I'm having asp.Net barf at me when I submit the a form with a
I have a asp.net web form which will submit information to come as emails.
I have an ASP.NET MVC 2 form that is working perfectly, doing client side
I'm experimenting with validating forms in the asp.net MVC framework. I'm focusing on server

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.