Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 如何在ASP.NET MVC5中添加美元符号?_Asp.net Mvc_Asp.net Mvc 5 - Fatal编程技术网

Asp.net mvc 如何在ASP.NET MVC5中添加美元符号?

Asp.net mvc 如何在ASP.NET MVC5中添加美元符号?,asp.net-mvc,asp.net-mvc-5,Asp.net Mvc,Asp.net Mvc 5,如何在无法编辑的文本框前添加美元符号?我想要美元符号,这样人们就不需要自己键入“$”。这是我的密码: @Html.Label("lblP1", "Rate 1", htmlAttributes: new { @class = "control-label", @style = "margin-right: 30px" }) <br /> @Html.EditorFor(m => m.Pricing.Price1, null, new { htmlAttributes =

如何在无法编辑的文本框前添加美元符号?我想要美元符号,这样人们就不需要自己键入“$”。这是我的密码:

    @Html.Label("lblP1", "Rate 1", htmlAttributes: new { @class = "control-label", @style = "margin-right: 30px" })
<br />
@Html.EditorFor(m => m.Pricing.Price1, null, new { htmlAttributes = new { @type = "string", @class = "form-control" } })

这是一个使用引导的示例:

<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text">$</span>
  </div>   
  @Html.EditorFor(m => m.Pricing.Price1, null, new { htmlAttributes = new { @type = "string", @class = "form-control" } })      
</div>
资料来源: