2011-07-28 17 views
0

をすべてのパラメータを受け取りません。強く型付けされたモデル、:コントローラは、私は次のシグネチャとのActionResultを実行しています、私のMVC Webアプリケーションでフォーム内

<% Using Html.BeginForm(ViewData("action").toString, "Article", FormMethod.Post, New With { .class = "basic"}) %> 
<div class="inner-form"> 
    <%= Html.MyValidationSummary("Por favor corrija os erros e tente novamente.")%> 
    <dl> 
     <dt><label for="name">Descri&ccedil;&atilde;o:</label></dt> 
     <dd><%= Html.TextBox("description", Model.description, New With {.class = "txt"})%></dd> 
     <dt><label for="type">Tipo:</label></dt> 
     <dd><%= Html.DropDownList("type", New SelectList(ViewData("typeList"), "value", "text", Model.type), New With {.class = ""})%></dd> 
     <dt id="image_dt"></dt> 
     <dd id="image_dd"> 
     <fieldset id="img_fieldset"> 
     <legend style="font-weight: bold;">Imagem</legend> 
     <label for="portrait_image_url">Url da Imagem:</label> 
     <%= Html.TextBox("image_url", Model.image_url, New With {.class = "txt"})%> 
     <label for="portrait_bigimage_url">Url da Imagem Portrait:</label> 
     <%= Html.TextBox("portrait_bigimage_url", Model.portrait_bigimage_url, New With {.class = "txt"})%> 
     <label for="landscape_bigimage_url">Url da Imagem Landscape:</label> 
     <%= Html.TextBox("landscape_bigimage_url", Model.landscape_bigimage_url, New With {.class = "txt"})%> 
     </fieldset> 
     </dd> 
     <dt id="video_dt"></dt> 
     <dd id="video_dd"> 
     <fieldset id="video_fieldset"> 
     <legend style="font-weight: bold;">Video</legend> 
     <label for="video_url">Url do Video:</label> 
     <%= Html.TextBox("video_url", Model.video_url, New With {.class = "txt"})%> 
     <label for="video_fullscreen">Url do Video Fullscreen:</label> 
     <%= Html.TextBox("video_fullscreen", Model.portrait_bigimage_url, New With {.class = "txt"})%> 
     </fieldset> 
     </dd> 
     <dt></dt> 
     <dd><input class="button" type="submit" name="submitButton" value="Gravar" /> <input class="button" type="submit" name="submitButton" value="Cancelar" /></dd> 
    </dl> 
</div> 
<% End Using%> 

今何が起こっているが、私はこのフォームを送信する際に、説明のみのプロパティは私のオブジェクトに割り当てられていることです。 他のプロパティが私のクラスで満たされていない理由を知りたい(私はフィドラーでチェックし、すべてが正しく送信されている)。

答えて

1

プロパティがModelにあることを確認してください。

また、ViewがあなたのModelを継承し、インテリセンスを得ることができます。

Inherits="System.Web.Mvc.ViewPage(Of Your Model)" %>

関連する問題