2012-07-05 32 views

回答

1
@Html.TextBox("Place textbox name here", "Place default value here") 
@Html.TextBoxFor(Model field declaration here, new { Value = "Place default value here" } 

如果你想使用輸入掩碼,那麼你可能需要看看這裏jquery input mask

3

你可以使用HTML5佔位符。適用於Chrome和Firefox。 U可以使用modernizr使其在IE和其他舊瀏覽器中工作。

How to set up modernizr for placeholder

@Html.TextBoxFor(model => model.Name,new { placeholder = "Fill in your name" }) 
相關問題