2015-06-19 28 views
-3

我想建立一個使用MVC的視圖,我將使用html.textareafor,我想知道如果我能夠在輸入字符串之前在此html.textareafor上使用工具提示。是否可以使用html.textareafor通過工具提示來顯示字符串。

+3

任何事情都是可能的。你有什麼嘗試?請發佈您的正在進行的實施。 – JAL

+1

如果您需要爲TextArea定製CSS Tooltip - http://www.jqueryscript.net/demo/Easy-Tooltip-Plugin-for-jQuery-tooltip-js/ – ramiramilu

回答

0

HTML工具提示源自title屬性,它們不是嗎?你可以add custom HTML attributes到你的助手:

@Html.TextAreaFor(model => model.SomeValue, new { title = model.SomeTooltipValue }) 
0

使用TextBoxFor,你將能夠通過anonmous對象通過自定義屬性值

的HTML輔助@標題=「幫助」會做的伎倆

@Html.TextBoxFor(model => model.Title, new {@title="help text"}) 

請看這個鏈接。 Link