ASP.NET MVC加载多个部分意见纳入使用JQuery一个DIV [英] ASP.NET MVC loading multiple partial views into a single div using JQuery

查看:101
本文介绍了ASP.NET MVC加载多个部分意见纳入使用JQuery一个DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作是由一个导航树,内容框,搜索框的帮助页面。导航树有常见问题和术语,每个都与它返回部分意见操作链接。

I am working on a help page which is composed of a navigation tree, content box, and search box. The navigation tree has links to Frequently Asked Questions and Glossary, each of which are linked to an Action which return partial views.

要导航树的右边我有,我想遏制任何局部视图在导航树中选择一个内容DIV。

To the right of the navigation tree I have a single content div that I would like to contain whichever partial view is selected in the navigation tree.

成功案例(我想要完成的任务):标签上的FAQ链接之一点击呼叫 FAQ()方法在我的控制器,然后返回一个局部视图,然后显示在我的内容股利导航树的右侧。点击另一个项目将导致加载另一个局部视图。

Success case (what I want to accomplish): clicking on one of the FAQ links calls the FAQ() method in my controller, then returns a partial view which is then displayed in my content div to the right of the navigation tree. Clicking on another item would cause another partial view to be loaded.

我怎么去呢?我读过一吨ASP.NET MVC的JQuery加载的博客文章和教程,但无法找到任何人谁也正是做到了这一点。

How do I go about this? I've read a ton of ASP.NET MVC JQuery loading blog posts and tutorials but can't find anyone who's done exactly this.

非常感谢!

推荐答案

您应该能够使用jQuery的方法 .load()加载HTML到您的股利。
http://api.jquery.com/load/

You should be able to use the jQuery method .load() to load HTML into your div. http://api.jquery.com/load/

您可以创建一个返回的局部视图为HTML的操作。
<一href=\"http://stackoverflow.com/questions/767722/asp-net-mvc-returning-partial-view-as-a-full-view-page\">http://stackoverflow.com/questions/767722/asp-net-mvc-returning-partial-view-as-a-full-view-page

You can create an action that returns the partial view as HTML. http://stackoverflow.com/questions/767722/asp-net-mvc-returning-partial-view-as-a-full-view-page

这篇关于ASP.NET MVC加载多个部分意见纳入使用JQuery一个DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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