Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* Razor - TextBoxForにデフォルト値を設定する [#u70d8c0d]
** 方法1 Valueプロパティを設定する [#x8ee9d96]
*** Controller [#a9f4e87d]
public ActionResult Index()
{
//here you must set VALUE what u want,
//for example I set current date
Viewbag.ExactlyWhatYouNeed = DateTime.Now
return View();
}
*** View [#pcb1fa8c]
@Html.TextBoxFor(model => model.CurrentDate, new { @Valu...
*** 参考 [#db1daf5f]
http://stackoverflow.com/questions/16625460/how-to-set-de...
** 方法2 TextBoxを使う [#ra6e45b9]
@Html.TextBox("CurrentDate", ViewBag.ExactlyWhatYouNeed)
*** 参考 [#od32bf37]
http://mohit-aspnet.blogspot.jp/2012/08/mvc-set-default-v...
終了行:
* Razor - TextBoxForにデフォルト値を設定する [#u70d8c0d]
** 方法1 Valueプロパティを設定する [#x8ee9d96]
*** Controller [#a9f4e87d]
public ActionResult Index()
{
//here you must set VALUE what u want,
//for example I set current date
Viewbag.ExactlyWhatYouNeed = DateTime.Now
return View();
}
*** View [#pcb1fa8c]
@Html.TextBoxFor(model => model.CurrentDate, new { @Valu...
*** 参考 [#db1daf5f]
http://stackoverflow.com/questions/16625460/how-to-set-de...
** 方法2 TextBoxを使う [#ra6e45b9]
@Html.TextBox("CurrentDate", ViewBag.ExactlyWhatYouNeed)
*** 参考 [#od32bf37]
http://mohit-aspnet.blogspot.jp/2012/08/mvc-set-default-v...
ページ名: