如何在不暂停页面的情况下使用数据库中的信息更新网页(使用c#,asp,MV4) [英] How can I update a webpage with information from a database without pausing the page(with c#, asp, MV4)

查看:63
本文介绍了如何在不暂停页面的情况下使用数据库中的信息更新网页(使用c#,asp,MV4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我目前正在研究创建基于网络的应用而非独立应用的可能性。



我们在c#中有很多现有代码用于访问我们想要重用的数据库和过滤搜索结果等。



我们的一个我们搜索的数据库是外部的,可能需要一段时间才能得到结果,因此我们想要显示获得结果提示,然后在结果出现时开始填充表格。



我尝试过使用AsyncController,但这似乎不让我显示页面(视图)然后用回调函数更新它(除非我做错了什么?)



我目前正在使用Visual Studio 2013 Express,如果有人知道有任何好的教程来做我需要的控制器等我会非常感激,我试图避免重复代码在JavaScript中



谢谢

解决方案

如果可以提供帮助,请不要使用Microsoft AJAX控件工具包。只需通过jquery使用AJAX,如果你想让你的页面自动更新,写一个计时器让它定期调用它(这就是所有控件都可以做的,但如果你自己编写它就可以控制和理解它)

Hello,

I'm currently investigating the possibility of creating a web based app instead of a stand-alone app.

we have alot of existing code in c# for accessing our databases and filtering search results etc that we want to reuse.

One of our databases we search is external and can take a while to get results, so we wanted to display a "getting results" prompt and then start populating a table as the results came in.

I've tried using an AsyncController but this doesn't seem to let me display the page (view) then update it with the callback function (unless I'm doing something wrong?)

I'm currently using Visual Studio 2013 Express at the moment, if anyone knows of any good tutorials for doing what I need with controllers etc I would be very grateful, I'm trying to avoid duplicating code in JavaScript

Thanks

解决方案

Do NOT use the Microsoft AJAX control toolkit if you can help it. Just use AJAX via jquery and if you want your page to auto update, write a timer to make it make it's call regularly ( that's all that control will do, but if you write it yourself you can both control and understand it )


这篇关于如何在不暂停页面的情况下使用数据库中的信息更新网页(使用c#,asp,MV4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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