50٪ تخفیف روی تمام دوره‌ها!
پایان تخفیف تا:
مشاهده دوره‌ها
0

بهم ریختگی کنترل ها در حالت تمام صفحه ( ASP.Net MVC )

با سلام به همه دوستان

میخواستم ببینم آیا میشه از Add View تو حالت فارسی استفاده کرد بصورتی که یک کلاس بهش بدیم و برامون ویو رو بسازه ..

من به همین صورت استفاده کردم زمانی که صفحه بصورت تمام صفحه در میاد کتنرل هایی صفحه بهم میریزه طبق عکس دوم

میخواستم ببینم دوستان پیشنهادشون چیه ..

عکس 1

با سلام به همه دوستان 
میخواستم ببینم آیا میشه از Add View تو حالت فارسی استفاده کرد  بصورتی که یک کلاس بهش بدیم و برامون ویو رو بسازه ..

من به همین صورت استفاده کردم زمانی که صفحه بصورت تمام صفحه  در میاد کتنرل هایی صفحه بهم میریزه  طبق عکس دوم

میخواستم ببینم دوستان پیشنهادشون چیه ..

||عکس 1::http://tosinso.com/files/get/18ae41c2-72cf-4b52-9465-79bc3f69976f||

||http://tosinso.com/files/get/9008d5f3-89b6-43e2-928f-a6aeb225d71e||



<htm>
@model MVC_Shop_04.Models.DomianModels.User

@{
    ViewBag.Title = Test;
    Layout = ~/Views/Shared/_Layout - 01.cshtml;
    //Layout = ~/Views/Shared/_Layout.cshtml;
}

    <h2>ثبت نام</h2>

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()

        <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.Username, htmlAttributes: new { @class = control-label col-md-2 })
                <div class=col-md-10>
                    @Html.EditorFor(model => model.Username, new { htmlAttributes = new { @class = form-control } })
                    @Html.ValidationMessageFor(model => model.Username, , new { @class = text-danger })
                </div>
            </div>

            <div class=form-group>
                @Html.LabelFor(model => model.Password, htmlAttributes: new { @class = control-label col-md-2 })
                <div class=col-md-10>
                    @Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = form-control } })
                    @Html.ValidationMessageFor(model => model.Password, , new { @class = text-danger })
                </div>
            </div>

            <div class=form-group>
                @Html.LabelFor(model => model.ConfirmPassword, htmlAttributes: new { @class = control-label col-md-2 })
                <div class=col-md-10>
                    @Html.EditorFor(model => model.ConfirmPassword, new { htmlAttributes = new { @class = form-control } })
                    @Html.ValidationMessageFor(model => model.ConfirmPassword, , new { @class = text-danger })
                </div>
            </div>


            <div class=form-group>
                @Html.LabelFor(model => model.BirthDate, htmlAttributes: new { @class = control-label col-md-2 })
                <div class=col-md-10>
                    @Html.EditorFor(model => model.BirthDate, new { htmlAttributes = new { @class = form-control } })
                    @Html.ValidationMessageFor(model => model.BirthDate, , new { @class = text-danger })
                </div>
            </div>

            <div class=form-group>
                @Html.LabelFor(model => model.Mobile, htmlAttributes: new { @class = control-label col-md-2 })
                <div class=col-md-10>
                    @Html.EditorFor(model => model.Mobile, new { htmlAttributes = new { @class = form-control } })
                    @Html.ValidationMessageFor(model => model.Mobile, , new { @class = text-danger })
                </div>
            </div>

            <div class=form-group>
                @Html.LabelFor(model => model.Tell, htmlAttributes: new { @class = control-label col-md-2 })
                <div class=col-md-10>
                    @Html.EditorFor(model => model.Tell, new { htmlAttributes = new { @class = form-control } })
                    @Html.ValidationMessageFor(model => model.Tell, , new { @class = text-danger })
                </div>
            </div>


            <div class=form-group>
                @Html.LabelFor(model => model.Gender, htmlAttributes: new { @class = control-label col-md-2 })
                <div class=col-md-10>
                    <div class=checkbox>
                        <select class= form-control>

                            <option value=true>مرد</option>
                            <option value=false>زن</option>

                        </select>
                        @Html.ValidationMessageFor(model => model.Gender, , new { @class = text-danger })
                    </div>
                </div>
            </div>


            <br />

            <div class=form-group>
                <div class=col-md-offset-2 col-md-10>
                    <input type=submit value=ثبت class=btn   btn-default  />
                </div>
            </div>

    }
<htm>
@model MVC_Shop_04.Models.DomianModels.User

@{
    ViewBag.Title = "Test";
    Layout = "~/Views/Shared/_Layout - 01.cshtml";
    //Layout = "~/Views/Shared/_Layout.cshtml";
}

    <h2>ثبت نام</h2>

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()

        <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.Username, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.Username, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Username, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.ConfirmPassword, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.ConfirmPassword, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.ConfirmPassword, "", new { @class = "text-danger" })
                </div>
            </div>


            <div class="form-group">
                @Html.LabelFor(model => model.BirthDate, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.BirthDate, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.BirthDate, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Mobile, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.Mobile, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Mobile, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Tell, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.Tell, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Tell, "", new { @class = "text-danger" })
                </div>
            </div>


            <div class="form-group">
                @Html.LabelFor(model => model.Gender, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    <div class="checkbox">
                        <select class=" form-control">

                            <option value="true">مرد</option>
                            <option value="false">زن</option>

                        </select>
                        @Html.ValidationMessageFor(model => model.Gender, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>


            <br />

            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    <input type="submit" value="ثبت" class="btn   btn-default " />
                </div>
            </div>

    }
پرسیده شده در 1395/06/03 توسط

1 پاسخ

0
  1. من توی این کدی که قرار دادی جایی نمیبینم که مثلا direction صفحه رو به rtl تغییر دادی باشی.
  2. شما در این کد بدون تعریف سطر به وسیله bootstrap دارین ستون تعریف میکنید. این هم می تونه مشکلزا باشه.
  3. از کلاس form-group به همون صورتی که در مستندات boostrap اومده استفاده کن و بعدش اگه خواستی درون یه ستون قرارش بده:
  4. <div class=col-md-10>
           <div class=form-group>
            
           </div>
    </div>
    
پاسخ در 1395/06/03 توسط

پاسخ شما