I am new in ASP.Net MVC. I have a model that has following fields: Event Name, Start time, End time, owner.

Now in the view I have similar to this (to render and post updated data through form):

<tbody>
    @if (Model.Events != null)
    {
       for (int i = 0; i < Model.Events.Count; i++)
       {
        <tr class="event-record">
        <td>@Html.TextBoxFor(m => m.Events[i].EventName, new { @class = "form-control" })</td>
        <td>@Html.TextBoxFor(m => m.Events[i].StartTime, new { @class = "form-control" })</td>
        <td>@Html.TextBoxFor(m => m.Events[i].EndTime, new { @class = "form-control" })</td>
        </tr>
        }
    }
</tbody>

Now my view doesn't have any input text field for owner and I intent to fill that owner field by javascript and post that information along with other fields that are visible.

[UPDATE]Here is my HTTP Post action:

[HttpPost]
[MultipleButton(Name = "action", Argument = "EventSaveExit")]
public ActionResult EventSaveExit(MasterEvent masterEvents)
{
    CreateUpdateEvent(masterEvents);
    return Redirect("/");
}

How can I achieve that result?

Thanks in advance!

Related posts

Recent Viewed