如何在ASP MVC的视图中加载选定的partialview? [英] How to load selected partialview in a view in ASP MVC?
问题描述
I am working on ASP.NET Mvc project. i have a view similar to image:
enter image description here
I design right panel in layout. my layout code:
我的尝试:
What I have tried:
列表
添加用户 - 部分查看1
编辑用户 - Partialview 2
用户列表 - Partialview 3
< a href =#class =list-group-item>设置密码 - 部分查看4
用户详细信息 - 部分视图5
发送消息 - 部分视图6
Lists
Add Users - Partialview 1
Edit Users - Partialview 2
User List - Partialview 3
Set Password - Partialview 4
User Details - Partialview 5
Send Message - Partialview 6
i右边面板中有几种模式包含:添加,编辑,列表和...每种模式都有一个特殊的Partialview
。我想,当我点击右侧面板上的每个模式时,特殊的
部分视图加载在左侧。如何在asp mvc中动态加载partialview?
谢谢
i have several modes in right panel contains : Add,Edit,List and ... Each mode has a
special Partialview. I want, when i click on every mode on right panel, special
partialview load in left side. how can i load dynamically partialview in asp mvc?
thanks
推荐答案
Google [ ^ ]
如何在asp mvc中动态加载partialview?
how can i load dynamically partialview in asp mvc?
根据您的需要,有几种方法可以做到这一点。一种方法是使用jQuery加载方法。例如:
There are a few possible ways to do it, depending on your needs. One approach is to use the jQuery load method. For example:
('#div')。load('@ Url.Content (〜/ YourController / YourAction)');
('#div').load('@Url.Content("~/YourController/YourAction")');
以下是几个参考文献:
使用jQuery动态加载ASP.NET MVC部分视图BinaryIntellect知识库 [ ^ ]
如何使用jQuery Ajax在ASP.Net MVC中加载部分视图 [ ^ ]
当然,您可以通过google上的简单搜索找到更多示例;)
Here are couple of references:
Load ASP.NET MVC Partial Views Dynamically Using jQuery | BinaryIntellect Knowledge Base[^]
How to Load Partial Views in ASP.Net MVC Using jQuery Ajax[^]
And of course, you can find more examples by doing a simple search at google ;)
这篇关于如何在ASP MVC的视图中加载选定的partialview?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!