I私にHomeControllerのメソッドを作成し、以下の持っている:私はちょうどに戻ってる提出するヒットしかしASP.NET MVC方式
<% using (Html.BeginForm()) {%>
<fieldset>
<legend>Fields</legend>
<p>
<label for="headline">Headline</label>
<%= Html.TextBox("headline") %>
</p>
<p>
<label for="story">Story</label>
<%= Html.TextArea("story") %>
</p>
<p>
<label for="image">Image URL</label>
<%= Html.TextBox("image") %>
</p>
<p>
<input type="submit" value="Create News Story" />
</p>
</fieldset>
<% } %>
:ここ
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create([Bind(Exclude = "Id")]Article articleToCreate)
{
if (!ModelState.IsValid)
return View();
try
{
_db.AddToArticleSet(articleToCreate);
_db.SaveChanges();
return RedirectToAction("Index");
}
catch
{
return View();
}
}
としているビューを(フィールドがまだ埋められている)フォームと新しいストーリーは作成されません。なぜどんなアイデア?ありがとう。
編集:私はInnerException {"SqlDateTimeオーバーフローで次のエラーが発生します:1/1/1753 12:00:00 AMと12/31/9999 11:59:59 PMの間にある必要があります。"}
デバッガに尋ねましたか? – driis