我在asp.net中有一個編輯器字段,它需要是1和列表大小之間的整數輸入。 Atm我得到了這個代碼需要幫助:編輯器和數字asp.net
@ Html.Editor(「Prioriteit」+ item,new {htmlAttributes = new {@type =「number」,min =「0」,step =「1」,value = 「0」}}))
這是不是最大的名單,我知道這一點。但是,當我打開頁面,我仍然可以添加文本。 View with text in editor 有人可以幫我嗎? 提前感謝 改變了代碼的人的將其鏈接到另一個問題着想 代碼
@Html.TextBox("Prioriteit" + item,null, new { htmlAttributes = new { @type = "number", min = "0",step = "1", value = "0" } })
可能重複[如何強制Razor使Editorfor輸入浮點型變量的數字類型?](http://stackoverflow.com/questions/33755560/how-to-force-razor-to-make-editorfor-輸入數字類型爲浮點變量) – Webbanditten
從那裏的解決方案沒有幫助我。已經嘗試過,發佈之前... –
是否有任何特殊原因使用輔助方法?並不只是使用'' – Webbanditten