我的 aspx 页面中有很多 div 。如何更新特定div的内容?
我的 aspx 页面中有很多 div。如何更新特定div的内容?
它应该每隔一分钟更新一次。 无需重新加载整个页面..
I have many div in my aspx page. how to update the content of a particular div?
It should update every one minute time interval..
with out reloading entire page..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然可以像 Raj 指出的那样,但要求您发回仅需要的 HTML 代码。如果您将其放在 ASPX 页面中,它将发送您不想要的完整 HTML。
如果您使用 MS-AJAX / UpdatePanel 完成此操作,则可以使用 jQuery 或 JavaScript 计时器来触发隐藏按钮,这将导致任何服务器端代码更新。
如果您想要一些示例,请告诉我
编辑 - 新代码示例
这是通过 jQuery 在 HTML HEAD 中
然后在 HTML 正文中
Certainly can do as Raj has pointed out but requires you to send back HTML code that is only thats needed. If you've got it in a ASPX page, it'll send the full HTML which is not that you want.
If you've done it with with MS-AJAX / UpdatePanel, you can use jQuery or a JavaScript timer to trigger a hidden button which will cause any server side code to update.
Please let me know if you want some examples
EDIT - new code sample
This is via jQuery, in the HTML HEAD
Then in your HTML body