局部视图中的静态内容mvc4

时间:2014-07-15 11:49:36

标签: asp.net-mvc-4 c#-4.0 razor

我有两个观点,如下所示:

boott.cshtml

@model model
<div>
    @if (Model.ViewModel != null)
    {
        @Html.Partial("_b_table", Model)
    }
    <span class="d2-fldr">Enter folder name: </span>

    <input type="text" name="txtName" class="txtFldrname"/>

    <a class="small d2-createfldr" title="Create folder" href="#">
    <span class="glyphicon glyphicon-plus d2-ico"></span>
    <span class="d2-axn">Create folder</span>
    </a>
)
</div>

_boott_table.cshtml

@model model

<div class="@BOOTSTRAP.ROW">
    -- some content from model
</div>

视图boott.cshtml直接从控制器的动作&#34; boott&#34;中呈现。 部分视图_boott_table.cshtml内容总是根据我们在局部视图中选择的选项进行更改。

当我们点击部分视图中的选项时,我们正在调用相同的操作方法&#34; boott&#34;并渲染部分boott.cshtml并发回html。 但是boott.cshtml(spans,input,tag)中有一些静态内容,它们不是部分视图_boott_table.cshtml的一部分,当我们点击_boott_table.cshtml中的选项时,不应该重新呈现。 我们如何处理这种情况?

有人可以建议吗?/

0 个答案:

没有答案
相关问题