开发者

Is it a bad practice to use UpdatePanel for Ajaxing in MVC views?

开发者 https://www.devze.com 2023-03-23 22:34 出处:网络
In a MVC app, I\'m trying to refresh a content of a view every few seconds. Normally in MVC you call controller method that returns a partial views (jQuery is an option to call the controller). What I

In a MVC app, I'm trying to refresh a content of a view every few seconds. Normally in MVC you call controller method that returns a partial views (jQuery is an option to call the controller). What I'd like to know is whether i开发者_如何学JAVAt is a bad practice to use UpdatePanel for Ajaxing in MVC views?


The preferred way to use Ajax in ASP.NET MVC is to use jQuery Ajax.

Why would you want to use an UpdatePanel? Maybe you should reconsider your choice of using MVC over WebForms?


You could preload the content and make it change every few seconds.

0

精彩评论

暂无评论...
验证码 换一张
取 消