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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:00:58+00:00 2026-06-01T11:00:58+00:00

I have a form in my aspx markup. I add to it some fields

  • 0

I have a form in my aspx markup.

I add to it some fields dynamically.

I submit them to a controller’s action.

How should I read them in the server side ?

Update

  1. My form contains n textboxes.

  2. I have thought to use one model that will contain an
    IEnumerable<FormItem>

in the client side I’ll fill it with Ajax form.

Make sense?

  • 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-01T11:01:00+00:00Added an answer on June 1, 2026 at 11:01 am

    I have thought to use one model that will contain an IEnumerable

    Yeah, great idea. So once you have defined the FormItem class (depending on your needs) you are ready to roll:

    public class FormItem
    {
        public string Value { get; set; }
    }
    

    and then:

    <form id="myform" action="/" method="post">
        <!-- Those inputs could be added dynamically -->
        <input type="text" name="[0].Value" />
        <input type="text" name="[1].Value" />
        <input type="text" name="[2].Value" />
        <input type="text" name="[3].Value" />
    
        <button type="submit">OK</button>
    </form>
    

    and finally AJAXify the form:

    $(function() {
        $('#myform').submit(function() {
            var form = $(this);
            $.ajax({
                url: form.attr('action'),
                type: form.attr('method'),
                data: form.serialize(),
                success: function(result) {
    
                }
            });
        });
    });
    

    Make sure you checkout Phil Haack’s blog post about the expected wire format for binding to lists.

    Steve Sanderson’s blog post post about editing a variable length list is also a must read.

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

Sidebar

Related Questions

I have the following client side code: <form action=PhotoStore.aspx id=form1 method=post enctype=multipart/form-data> <div> <input
So, in example of DotNetOpenAuth I have form in aspx: <form action=Authenticate?ReturnUrl=<%=HttpUtility.UrlEncode(Request.QueryString[ReturnUrl]) %> method=post
I have a form on home.aspx that is this: <form name=search method=post action=searchresults.aspx id=searchform
I have a form representing a survey that is dynamically generated based on some
I have an .aspx form with 20 fields that must be disable based on
I currently have a web form aspx page that calls RegisterClientScriptBlock. This sends down
I am using .NET2.0. Let's say a have a simple aspx form with txtInput
I have a .aspx Web Form with a .aspx.cs code-behind. The code-behind is nearly
my structure is like this: master page aspx(web form) ascx(user control) I have a
I have a child page LoginContent.aspx which contains a login form. If the user

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.