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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:38:44+00:00 2026-05-27T01:38:44+00:00

I am looking for the best way to create ajax enabled subforms from items

  • 0

I am looking for the best way to create ajax enabled subforms from items in a list with MVC 3. A static list of values should be generated, but with an “edit” link/button next to every item, to toggle inline edits.

I did follow the tutorial at this link

http://blog.janjonas.net/2011-07-24/asp_net-mvc_3-ajax-form-jquery-validate-supporting-unobtrusive-client-side-validation-and-server-side-validation [1]

However it is based on the form edit fields always being visible

I’d like to show a static list with field values, but let the user activate an edit field by clicking “edit” (e.g. button)

I did modify the example at [1] by creating a default partial view with a form with submit button only. When posting the data by ajax the edit form will show. It looks like it is working, (I only need to hide validation errors on the first POST – which does not send real data).

Update:
An even better solution would probably be to leave out all forms in the static view, just have a single css class button/link next to each item, and let jquery fetch the relevant view for the clicked item. I am not sure how to do that with MVC 3+jQuery though.

Another update:
I discovered Ajax.Actionlink, which did exactly what I wanted!

  • 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-27T01:38:45+00:00Added an answer on May 27, 2026 at 1:38 am

    I found out how to do it, and it turned out to be real simple!

    I created two partial views.

    One for rendering each static item. I used used Ajax.ActionLink with InsertionMode “replace”, and set the parent of the item as the target

    The second for rendering the form. Here I used Ajax.Beginform with similar options.

    On successfully saved data, I returned the static view, on failure, I returned the partial view with the ajax form again.

    I’m happy I found a MVC-centric way to do it (although it is fun creating custom stuff with jQuery)

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

Sidebar

Related Questions

What's the best way to create printable letters from an MVC application? I'm looking
I'm looking for the best way to create a unique ID as a String
I'm looking for the best way to create a custom border around an HTML
I need to create the following functionality, and looking for the best way to
I'm looking to the best way to overriding the _get_url method from ImageField, I
I am very new to MVC and am looking for the best way to
I'm looking for the best way to start an intent from a class that
I'm looking the best way to create a group of four buttons. Each button
Looking for some help on the best way to create a custom UIActivityIndicator. I
I'm looking for the best way to create a block of left-aligned text and

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.