[英]How do I make my text box only take numbers?
我要設置它,以便您只能在文本框中輸入值(簡單明了)。 但是圖片顯示了我得到的結果。 知道是什么問題嗎? 幾個月前,我已經建立了一個這樣的文本框,所以我知道如果行得通,那行中的內容也可以。
HTML代碼:
if (Roles.IsUserInRole(WebSecurity.CurrentUserName, "Admin")) { @:<p><b>Customer ID:</b> @Html.TextBox("SearchString2", new {@type="number"})</p> }
提前致謝。
您使用錯誤的Html.TextBox()重載( 此一個 ),其中第二個參數是要顯示的值。 你需要用這個
Html.TextBox()
@Html.TextBox("SearchString2", null, new { @type="number" })
[英]how to make a numbers and the letter e only text box?
[英]How do I make my DIV only take up the width of the elements it contains?
[英]How do I scrape only the numbers and not the text following the numbers?
[英]How can I make my form take only a limited space?
[英]How do I make the text in a text box affect code?
[英]How do I make a DIV only take up horizontal space its elements take up?
[英]How do I make a transparent box without affecting text?
[英]How do I make the text box bigger in HTML/CSS?
[英]How do I make text input box bigger with CSS?
[英]How do i make text visible in right side of a box
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.