I have EditorFor
in my view. Like this
@Html.EditorFor(model => model.First().Link, new { htmlAttributes = new { @class = "form-control", placeholder = "Email", id= "start" } })
Also I am an Action in the controller, which finds all NULL in the table from the database and updates it with some value, here is the code
public ActionResult Update(string start="lol") { ApplicationDbContext context = new ApplicationDbContext(); IEnumerable<InvitationMails> customers = context.InvitationMails .Where(c => c.Link == null) .AsEnumerable() .Select(c => { c.Link = start; return c; }); foreach (InvitationMails customer in customers) {
In the "View Indexes" window, I click the "Update Action" button and run it. Here is the code
<ul class="btn btn-default" style="width: 150px; list-style-type: none; font-size: 16px; margin-left: 20px"> <li style="color: white">@Html.ActionLink(" ", "Update", "InvitationMails", null, new { @style = "color:white" })</li> </ul>
But here is an update with a static value, and I want to get the value from VIew. How can I write my code?
user7629010
source share