ASP.NET MVC 4 Html.BeginForm in Partial View , values after post not right

半世苍凉 提交于 2019-11-29 12:37:47
Mir Gulam Sarwar

I had this kind of issue when i have multiple Partial view in a single Parent View.What you should do is that, In the Parent View Call Section1 Paritial View like

 <div id="tab-section1">
            @{Html.RenderPartial("_Section1", Model.Section1);}
        </div>

Now in the _Section1 Partial View call your _Section2 Partial View

<div id="section2">
                @{Html.RenderPartial("_Section2", Model.Section2);}
            </div>

Using this Approach of Partial View inside of a Partial View you will be able to get Value from your UI.This is applicable for multiple partial view inside a parent view. Also i like call my partial view like

@Html.Partial("ViewName",Model.ModelName)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!