I'm just started learning Bootstrap and ASP.Net MVC, a got little stuck.
This is my view:
@model Vrtic_2546.Models.Dogadjanja
@{
ViewBag.Title = "Create";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Create</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Dogadjanja</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.KorisnikID, "KorisnikID", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("KorisnikID", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.KorisnikID, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Naziv, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Naziv, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Naziv, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Opis, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextAreaFor(model => model.Opis, new { rows = "", cols = "", style = "width: 90%; height: 90px;" })
@Html.ValidationMessageFor(model => model.Opis, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Datum, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Datum, new {htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Datum, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Text, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextAreaFor(model => model.Text, new { rows = "5", cols = "56", style = "" })
@Html.ValidationMessageFor(model => model.Text, "", new { @class = "text-danger" })
</div>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
And this is how it renders:
Picture
So, I need set up large "Text" textarea with text editor, a still keep it aligned from the left side.
What I have tried:
I tried few Bootstrap classes(col-lg10..etc), defined rows and columns, rows do get applied but columns don't. I'm not sure where is the problem is, can't grasp it, so any kind of help would be greatly appreciated.