2013-10-07 64 views
1

變量的值,我需要的幫助:我想知道的,例如reception0值:獲得在剃刀

<td > 
    <label name="[email protected](i)">@Model[1][i]._tag</label> 
    </td> 
    <td> 
    <input type="text" value="@Model[1][i]._client" name="[email protected](i)"/> 
    </td> 
    <td> 
    <input type="text" value="@Model[1][i]._reception" class="datepicker" name="[email protected](i)"/> 
    </td> 
    <td> 
    <input type="text" value="@Model[1][i]._cloture" class="datepicker" name="[email protected](i)"/> 
    </td> 
    <td> 
    @Html.ActionLink("enregistrer","Index", new {identificateur = Model[1][i].Id, Pages = "1", _reception ="reception"+""+i.ToString(), _cloture ="cloture"+""+i.ToString(), _client ="client"+""+i.ToString(), tag = "tag"+""+i.ToString() }) 
    </td> 

我的問題是,我得到_reception = reception0但我需要的reception0不是它的名稱值。

我該如何解決我的代碼段?

回答

0

使用您在鏈接助手

@Html.ActionLink(... , _reception = Model[1][i]._reception, ...) 
+0

它是在一個'for'聲明,我對造成我很多問題 –

+1

@Lamloumi使用您輸入的值 - 你正在使用它的ActionLink的內已經爲id。具體來說,使用'i'導致了什麼問題? –

+0

問題是我需要通過默認值Model [1] [i] ._ reception'或者在'如果我改變了代碼,就像你說的那樣,我總會得到舊的值 –