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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:22:47+00:00 2026-06-04T15:22:47+00:00

I have a template <script id=template type=text/x-jquery-tmpl> <div class=experience> <label for=c${count}>New Thing:</label> <input type=text

  • 0

I have a template

<script id="template" type="text/x-jquery-tmpl">
<div class="experience">
    <label for="c${count}">New Thing:</label>
    <input type="text" id="c${count}" name="Fund[${count}].Name" />
    <label for="c${count}">New Thing count:</label>
    <input type="text" id="c${count}" name="Fund[${count}].FundNo" />
</div>

to which I add controls dynamically to a div container.

I have a model in my mvc application

[Serializable]
public class Step2ViewModel : IStepViewModel
{
    [Required]
    public List<FormTest.Models.Item> Things;
}

[Serializable]
public class Item
{
    public string Name { get; set; }
    public string Number { get; set; }
}

How do I bind these newly created controls to a model. Does that entail using
@Html.LabelFor, @Html.TextBoxFor etc in my template?

thanks!

Edit:

Just in case the question is open to interpretation – I want to bind dynamically created controls ( which was done using templ() ) to the List in my model when the form is posted.

  • 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-04T15:22:49+00:00Added an answer on June 4, 2026 at 3:22 pm

    First of all, you are using a project that will no longer have more updates and it was never finished.

    Boris Moore created a way to continue jQuery template project and it’s called JsRender. With JsRender you have the power of jQuery Templates, and much much more, like accessing paths, use of helper functions, have no dependency on jQuery whatsoever, and list goes on and on…

    PluralSight have an entire 3 hours course just for JsRender (so you can see the importance of it), you can start seeing it with a Trial account.


    Now regarding your actual issue

    Every time you want to make the .NET framework fill up the Model for you upon submitting a form, you have to make sure that you write the each property as you had an array, so you need to pass the entire full path of your model.

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

Sidebar

Related Questions

I have the following KnockoutJS template (render with jquery.tmpl): <script id=contactsTemplate type=text/html> <li data-bind=click:
I have a template like script type: text/template, id: list-template, ''' <div class=display> <div
I have the following in my page, ready to: <div id=result></div> <script id=some-template type=text/x-handlebars-template>
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
I have the following jQuery script running on my page: <script type=text/javascript charset=utf-8 src={{
I'm using jQuery Raty and I have the following script: <script type=text/javascript charset=utf-8 src={{
I'm currently generating a list using the jQuery tmpl plugin : <script id=mainTemplate type=text/x-jquery-tmpl>
I have a knockout template like this: <script type=text/html id=list> <ul data-bind=foreach: items> <li
I have follwing JSON: {mykey:[{name:Jak,interests:movies}]} and following opensocial app code: <script type=text/os-template require=mykey> <ul>
in template: <script type=text/javascript> $.ajax({ type:POST, url:{% url DrHub.views.ajxTest %}, data: { 'start': $('#id_startTime').val(),

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.