当asp.net中的XML文件发生更改时,强制所有打开的会话刷新其页面 [英] Force all open sessions to refresh their page when an XML file changes in asp.net

查看:87
本文介绍了当asp.net中的XML文件发生更改时,强制所有打开的会话刷新其页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示从XML文件填充的网格的页面,所有用户都可以编辑该文件,我希望页面更新以反映任何人对我尝试使用FileSystemWatcher对象尝试的XML文件所做的任何更改监视XML文件的更改并在DataBind发生更改时触发它,我得到一个进程无法访问文件'C:\..bbcrlog.xml',因为它正由另一个进程使用。



有不同的方法吗?



我正在使用XMLDataSource和数据列表绑定到数据源。

解决方案

通过运行javascript函数解决它,使用jquery读取xml并动态更新页面,摆脱XMLDataSource和datalist对象..

I have a page that displays a grid populated from an XML file, all users can edit the file and I want the page to update to reflect any changes anyone has made to the XML file i've tried using a FileSystemWatcher object that monitors the XML files for changes and triggers a DataBind when it has changed, I get a "The process cannot access the file 'C:\..bbcrlog.xml' because it is being used by another process."

Is there a different way to do this?

I'm using a "XMLDataSource" and a datalist that is bound to the data source.

解决方案

Solved it by running a javascript function that uses jquery to read the xml and update the page dynamically, got rid of the XMLDataSource and datalist object..


这篇关于当asp.net中的XML文件发生更改时,强制所有打开的会话刷新其页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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