I have a table in my database and it has a column named title in nvarchar
datatype. I want to save the title that user enters in a textbox to table. In my view I used
@using (Html.BeginForm("savetodb", "Advertise", FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.TextBoxFor(m => m.AdTitle)
}
This view is strongly typed view from a ViewModel that has this property
public string AdTitle { get; set; }
I know how to save data from controller to database but I don't know how can I access data in my controller(in savetodb()
function). Can anybody help me please?
Thanks