I have a simple email form with TO, CC, BCC and another field for an attachment location i have the view working but i cant workout how to get all 3 ul lists to post to the controller

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">

        <div class="form-group">
            <label class="control-label col-md-2">To</label>
            <div class="col-md-10">
                <ul name="To" id="email-To"></ul>

            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">Cc</label>
            <div class="col-md-10">
                <ul name="CC" id="email-Cc"></ul>

            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">Bcc</label>
            <div class="col-md-10">
                <ul name="Bcc" id="email-Bcc"></ul>
            </div>
        </div>     

        <div class="form-group">
            @Html.LabelFor(model => model.FileName, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.FileName, new { htmlAttributes = new { @class = "form-control" } })
            </div>
        </div>

         <div class="pull-right">
                    <button type="submit" class="btn btn-success btn-xs">
                        <i class="fa fa-save"></i> Create
                    </button>
                </div>
    </div>
}

The model:

    public System.Guid ID { get; set; }
    public string To { get; set; }
    public string CC { get; set; }
    public string BCC { get; set; }
    public string FileName { get; set; }

It will post the filename but not the ul's im guessing i would need to do some kind of json post for this kind of thing im not two sure?

Related posts

Recent Viewed