2011-07-28 27 views
0

在我的MVC Web應用程序我運行具有以下簽名一個ActionResult:控制器未收到所有參數的形式內

Public Function Create(ByVal article As Article_Ad) As ActionResult 

在我的ASPX頁面我已經宣佈了下述形式字段對應模型,這是強類型:

<% 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)" %>

相關問題