Hello,
I'm trying to pass a List object from view to controller.
The program works by pressing the link "Add new line", this adds a new row to my web page, with a input box and i would like for that input box content, on submission, to be passed to my controller so that a can treat the data...
The code would be something like this

@model MyModel.Models.Line

@{
    ViewBag.Title = "Create";
}
@{
    Layout = "";
}

<h2> New Line</h2>

@using (Html.BeginForm())
{   
    @Html.ValidationSummary(true)
    @{var lines = new List<MyModel.Models.lines>();}
    <table class="createTable">
    </table>
    <a href="#" class="addNew">Add new line</a>
    <script type="text/javascript">
        $(function () {
                    jQuery(function () {
                        @{var line = new MyModel.Models.Line();}
                        jQuery('a.addNew').click(function (event) {
                            event.preventDefault();
                            jQuery('table.tableCreate').append('<tr><td>@Html.EditorFor(m=>line.Description)</td></tr>');

                        });
                    });
        });
    </script>
    <input type="submit" value="OK">
}

I would like some help, please.

Edited 4 Years Ago by Delusional

Thanks pritaeas.
From what i gathered in jQuery.ajax({data:{'listID':ids}}) data will be sent in the query string, would it be possible to not adding to the query and pass data another way?
Thanks in advance :)

This question has already been answered. Start a new discussion instead.