右对齐HTML.TextBoxFor中的文本

时间:2013-09-25 13:36:54

标签: c# asp.net-mvc asp.net-mvc-3 razor

我正在使用Twitter Bootstrap和ASP.Net MVC。

如何右键对齐TextBoxFor中的文本:

@Html.TextBoxFor(model => model.PaymentReceived, 
new { @class = "pmtallocated pull-right" , .dir = "rtl" })

我在上面尝试时收到错误Invalid expression term '.'

谢谢,

标记

2 个答案:

答案 0 :(得分:8)

new { @class = "pmtallocated pull-right" , @dir = "rtl" })

答案 1 :(得分:6)

尝试任何

@Html.TextBoxFor(model => model.PaymentReceived, 
new { @class = "pmtallocated pull-right" , @dir = "rtl" })

@Html.TextBoxFor(model => model.PaymentReceived, 
new { @class = "pmtallocated pull-right" , @style="text-align:right"})