简体   繁体   English

带有jQuery部分视图的Asp.Net MVC 4

[英]Asp.Net mvc 4 with jQuery partial view

I'm working with jQuery in a Asp.Net MVC 4 project. 我正在Asp.Net MVC 4项目中使用jQuery。

I have an Index with a table in a "content" div and other "content2" div to show partial views. 我在“ content” div和其他“ content2” div中都有一个带有表的索引,以显示部分视图。

When the user click on any item of the list, the Detail partial view is showed correctly in "content2". 当用户单击列表中的任何项目时,“局部”局部视图将正确显示在“ content2”中。 That Detail view has an Edit actionlink to call the controller that load your view in the same div ("content2"). 该“详细信息”视图具有“编辑”操作链接,以调用将视图加载到同一div(“ content2”)中的控制器。

When the Edit ended I refresh the list without problem in "content". 编辑结束后,我刷新列表时“内容”没有问题。

At this point is all working good. 此时一切正常。

I need that the "content2" div show again the original Detail, I mean the Detail that was called and edited. 我需要“ content2” div再次显示原始的Detail,我的意思是被调用和编辑的Detail。

I hope you can understand me! 希望你能理解我!

Thanks in advance 提前致谢

You have to pass the id of that item which was being edited as routevalues in your return statement like below return RedirectToAction("ActionMethod", new { ItemID = value }); 您必须在返回语句中传递正在被编辑为路由值的项目的ID,如下所示:return RedirectToAction(“ ActionMethod”,new {ItemID = value}); If you want to know more about Routing in ASP.Net MVC the link is given below: http://msdn.microsoft.com/en-us/library/cc668201(v=vs.100).aspx 如果您想了解有关ASP.Net MVC中路由的更多信息,请在下面给出链接: http : //msdn.microsoft.com/zh-cn/library/cc668201( v=vs.100) .aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM