我想在表格中插入一个固定的日期。我怎样才能做到这一点 ?
<div class="editor-label">
Description :
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.Description, new { @class = "textboxes" })
@Html.ValidationMessageFor(model => model.Description)
</div>
<div class="editor-label">
Date :
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.Date, new { @class = "textboxes" }) /// I wanna be here a fixed date .
@Html.ValidationMessageFor(model => model.Date)
</div>
我的控制器代码是:
public ActionResult Index(tblOrder tblorder)
{
if (ModelState.IsValid)
{
db.tblOrders.AddObject(tblorder);
db.SaveChanges();
return RedirectToAction("Index");
}
ViewBag.fxBudjet = new SelectList(db.tblBudjets, "ID", "Budjet", tblorder.fxBudjet);
ViewBag.fxServiceType = new SelectList(db.tblServiceTypes, "ID", "Service", tblorder.fxServiceType);
ViewBag.fxStartTime = new SelectList(db.tblStartDates, "ID", "StartDate", tblorder.fxStartTime);
return View(tblorder);
}
我需要更改我的控制器代码吗?