Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.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
Html MVC5中的文本区域_Html_Asp.net Mvc_Twitter Bootstrap_Model View Controller - Fatal编程技术网

Html MVC5中的文本区域

Html MVC5中的文本区域,html,asp.net-mvc,twitter-bootstrap,model-view-controller,Html,Asp.net Mvc,Twitter Bootstrap,Model View Controller,我正在使用Visual Studio 2013和MVC 5。我的观点包含以下代码: <div class="form-group"> <div class="col-lg-10 col-md-10"> @Html.LabelFor(m => m.GeneralInfo, new { @class = "col-md-4 col-lg-4 vert-middle" }) <div class="col-lg-8 col-md-8"&

我正在使用Visual Studio 2013和MVC 5。我的观点包含以下代码:

<div class="form-group">
   <div class="col-lg-10 col-md-10">
      @Html.LabelFor(m => m.GeneralInfo, new { @class = "col-md-4 col-lg-4 vert-middle" })
      <div class="col-lg-8 col-md-8">
          @Html.TextAreaFor(model => model.GeneralInfo, new { @class = "form-control", @rows = 5, @cols = 220 })
      </div>
    </div>
</div>

@LabelFor(m=>m.GeneralInfo,新的{@class=“col-md-4 col-lg-4 vert-middle”})
@Html.TextAreaFor(model=>model.GeneralInfo,new{@class=“form control”,@rows=5,@cols=220})
无论我做什么,我都不能让磁场增加它的宽度。我将从查看源代码生成的代码放在简单的html文件中,文件大小非常大。 我没有对引导代码进行更改。我使用的是3.3.4


如果您试图在预定义的引导网格属性中明确设置宽度,则会收到任何帮助。这是不可能的,也没有意义

您需要花一点时间来理解引导网格系统,这里有一个例子,它将在将来节省大量时间,如果您想使用BS,这是至关重要的

回到您的代码,如果您的TextArea已经在网格系统中,并且您希望以响应方式获得最大屏幕宽度,那么您应该使用如下内容:

 <div class="col-lg-12">
          @Html.TextAreaFor(model => model.GeneralInfo, new { @class = "form-control", @rows = 5 })
      </div>

@TextAreaFor(model=>model.GeneralInfo,new{@class=“form control”,@rows=5})
假设它不在另一个分区内


12是一个神奇的数字,请跟随该链接获取更多信息。

btoostrap3表单控件CSS类会自动将文本区域的宽度设置为100%。默认情况下,它与父容器一样宽。我希望它能这么简单。我对引导网格有点了解,但这不是答案。我能够找出问题所在。这是引导程序实现的。如果我删除了对引导的所有引用,并使用textarea创建了一个简单的表单,那么控制宽度就没有问题了。因此,我使用NuGet:Install-Package bootstrap.MVCThat升级引导程序,这也没有帮助。我必须专门为textarea创建样式,覆盖引导,并指定最小宽度:700px,例如,只有在宽度增加时。有什么想法吗?