【问题标题】:View within a view Layout issue在视图中查看布局问题
【发布时间】:2020-05-27 20:13:47
【问题描述】:

我想在视图中显示视图。这可以按我的意愿工作,但我对表格的布局有疑问。

我想将表格向左移动,使其位于地址按钮下方。我不太确定它为什么放在它所在的位置。这是我的报告视图。

    @{
        ViewBag.Title = "Reports";
        Layout = "~/Views/Shared/_layout.cshtml";
    }

    <h2>Reports</h2>
    <br />
    <button id="address">Addresses</button>
<button id="Qualifications"> Qualifications</button>
    <style>
        #addrRpt { color: red;
                   background-color:blue;
                   margin-left:10px;
                   /*height: 250px;*/
                       
        }

    </style>

    <script>
        document.getElementById("address").onclick = function () { myFunction() };
        function myFunction() {

            $("#addrRpt").load("@Html.Raw(Url.Action("index", "Addresses")) ")
        }
    </script>


    @*<div class="row" >
        <div class="col" style="background-color:red">
            
            <div id="addrRpt">
                </div>
            </div>
        </div>*@
    <div id="addrRpt"></div>

【问题讨论】:

    标签: html asp.net-mvc bootstrap-4


    【解决方案1】:

    将视图的布局设置为 null 解决了我的问题。

    布局=空;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-29
      • 1970-01-01
      • 2014-11-13
      相关资源
      最近更新 更多