PDA

View Full Version : سوال: چگونگی حذف فاصله زیاد بین تکست باکس و عنوان آن



armm1388
یک شنبه 17 فروردین 1399, 13:23 عصر
با سلام
در پروژه mvc من بین تکست باکس و عنوان آن در نمایش فاصله زیاد است. می خواهد عنوان در کنار خود تکست باکس باشد.
چه تغییری باید اعمال کنم؟
151542


این هم کد

@model ContosoUniversity.Models.EmpModel
@using (Html.BeginForm()){
@Html.AntiForgeryToken()
<div class="form-horizontal"> <h4>add new record</h4> <div> @Html.ActionLink("show list", "GetAllEmpDetails") </div> <hr /> @Html.ValidationSummary(true, "", new { @class = "text-danger" })

<div class="form-group"> @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" }) </div> </div>
<div class="form-group"> @Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.City, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.City, "", new { @class = "text-danger" }) </div> </div>
<div class="form-group"> @Html.LabelFor(model => model.Address, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Address, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Address, "", new { @class = "text-danger" }) </div> </div>
<div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="save" class="btn btn-default" /> </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10" style="color:green"> @ViewBag.Message
</div> </div> </div>}
<script src="~/Scripts/jquery-1.10.2.min.js"></script><script src="~/Scripts/jquery.validate.min.js"></script><script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>


این هم مدل:


public class EmpModel {
[Key]
[Display(Name = "Id")]
public int Empid { get; set; }


[Required(ErrorMessage = "وارد کردن نام الزامی است")]
[Display(Name = "name")]
public string Name { get; set; }
[Required(ErrorMessage = "وارد کردن نام الزامی است")]
[Display(Name = "city")]
public string City { get; set; }
[Required(ErrorMessage = "وارد کردن آدرس الزامی است")]
[Display(Name = "Address")]
public string Address { get; set; }


}
}
باتشکر