我在MVC3网站上有一个简单的表格,使用户能够创建竞争条目。 这一做法已经实施,目前正在实施罚款,但现已要求用户允许其条目为私人条目。
在我的入门模式中,我增加了一个养牛羊。 然后,我图示我会改变制作和编辑的超文本格式,以包括一个检查箱,具体说明该条目是否为私人。
I m new to MVC3, 但我的数字是,我可以简单地改变组成员额的行动,把新的蓝色参数包括在内。
不幸的是,这似乎并未奏效。 谁能告诉我,检查箱的数值如何从超文本转换到邮局行动? 这可能相当常见,但我似乎无法在网上找到这方面的榜样。 几乎所有例子都简单地显示案文投入,但我看不到任何检查箱。
表格:
<form method="post" action="../Entry/Create" enctype="multipart/form-data" onsubmit="return isValidInput()">
<input type="text" id="EntryTitle" name="EntryTitle" />
<div id="invalidTitle" class="invalidData"></div>
<p id="char-remaining">(100 characters remaining)</p>
<input type="text" id="EntryVideo" name="EntryVideo" />
<div id="invalidVideo" class="invalidData"></div>
<p id="vid-desc">(URL of the Video to Embed)</p>
<input type="file" id="ImageFile" name="ImageFile" />
<div id="invalidImage" class="invalidData"></div>
<p id="file-desc">(200x200px, jpeg, png, or gif)</p>
<textarea id="EntryDesc" name="EntryDesc"></textarea>
<div id="invalidDesc" class="invalidData"></div>
<br />
<input type="checkbox" id="isPrivate" name="isPrivate" />
Make my entry private.
<br />
(private entries will only be viewable by you and site administrators)
<br />
<button id="new-entry-save">save</button>
</form>
行动:
public ActionResult Create(string EntryTitle, string EntryVideo, HttpPostedFileBase ImageFile, string EntryDesc, Boolean isPrivate)
{
...
}