I want to display information in the GridView and search and edit the status using the Texbox.
how add button to change status
@model IEnumerable<Entity_Framework_Stored_Proc_MVC.Customer>
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width"/>
<title>Index</title>
</head>
<body>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
<span>Customer Name:</span> @Html.TextBox("CustomerName")
<input type="submit" value="Search"/>
<br/>
<br/>
<table cellpadding="0" cellspacing="0">
<tr>
<th>CustomerID</th>
<th>ContactName</th>
<th>City</th>
<th>sttus</th>
</tr>
@foreach (Customer customer in Model)
{
<tr>
<td>@customer.CustomerID</td>
<td>@customer.ContactName</td>
<td>@customer.City</td>
<td>@customer.status</td>
</tr>
}
</table>
}
</body>
</html>
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
NorthwindEntities entities = new NorthwindEntities();
return View(entities.SearchCustomers(""));
}
[HttpPost]
public ActionResult Index(string customerName)
{
NorthwindEntities entities = new NorthwindEntities();
return View(entities.SearchCustomers(customerName));
}
}