MVC阿贾克斯的UpdatePanel [英] MVC Ajax UpdatePanel

查看:153
本文介绍了MVC阿贾克斯的UpdatePanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道(至少我是pretty的肯定)没有对MVC中的控制,如ASP:UpdatePanel中。任何人都可以给我如何做到这一点一些了解。

I know (at least i'm pretty sure) there isn't a control for MVC like the asp:UpdatePanel. Can anyone give me some idea on how to do this.

我有我添加条目,从我的仓库及放大器的集合;服务层。在我的母版我想显示警报取决于是否有此集合什么。

I have a collection that i add entries to from my repository & services layers. in my masterpage i would like to show an alert depending on if there is anything in this collection.

一般情况下我有一个UpdatePanel的的UpdateMode =始终,它会检查收集并显示我的信息。

Normally i would have an UpdatePanel whose UpdateMode="Always" and it would check the collection and display my messages.

你知道我是如何实现MVC类似的东西?

Do you know how i can achieve something similiar in MVC?

推荐答案

远离UpdatePanel的概念都在一起。

Stay away from the UpdatePanel concept all together.

ASP.NET MVC包括jQuery的,这是完全由微软现在支持。您将要创建的局部视图(的RenderPartial),使通话回到控制器上的一个方法,返回JSON。

ASP.NET MVC includes jQuery, which is fully supported by Microsoft now. You will want to create partial views (RenderPartial) that make calls back to a method on a controller, that returns JSON.

然后,使用jQuery要连接的控制和局​​部视图。

Then, use jQuery to wire up the control and partial views.

jQuery是一个非常强大的JavaScript库。我强烈推荐书的jQuery在行动的参照系,以潜入ASP.NET MVC /脚本/ jQuery的-xxxjs文件。 :)

jQuery is an extremely powerful javascript library. I highly recommend the book jQuery in Action as a reference when diving into the ASP.NET MVC /Scripts/jquery-x.x.x.js files. :)

这篇关于MVC阿贾克斯的UpdatePanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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