如何在Mvc 4 Razor Html中创建多个局部视图 [英] How Do I Create More Than One Partial View In Mvc 4 Razor Html

查看:85
本文介绍了如何在Mvc 4 Razor Html中创建多个局部视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i是MVC新手,



i我正在使用两个局部视图两个用户控件让它第一个第二个,实际上它应该通过该URL从用户控件获取数据,具体取决于查询字符串。

问题是当我运行页面时,第一和第二部分视图显示相同的值(正好是第一个显示的)





@ Html.Partial(〜/ Views / Shared / _first.vbhtml)它将引用.ascx文件的URL



@ Html.Partial(〜/ Views /分享/ _second.vbhtml)



所以请给我一个解决方案,如果你需要更多,我肯定会



提前感谢



Velsamy A

hi everyone,

i am new to MVC,

i am using two partial view s for two user controls let it be first and second, actually it should fetch the data from the user controls through that URL depending upon the query string.
problem is while i run the page, both first and second partial view displaying same value(exactly what first one shows)


@Html.Partial("~/Views/Shared/_first.vbhtml") it will refer the .ascx file's url

@Html.Partial("~/Views/Shared/_second.vbhtml")

so give me a solution please, if you need more , sure i will

thanks in advance

Velsamy A

推荐答案

这篇关于如何在Mvc 4 Razor Html中创建多个局部视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆