SPStatefulLongOperation的使用
有人能给我一个使用 SPStatefulLongOperation 的例子吗?它的记录非常少。
Can someone give me an example of the use of SPStatefulLongOperation? It's very poorly documented.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我刚刚使用的代码示例。它将
ThmxTheme
(selectedTheme
) 应用于SPSite
(site
) 中的所有SPWebs
)。请注意,
opState.State
的当前值每次都会附加到客户端的 HTML(通过HttpContext.Current.Response.Write
和.Flush
)第二。因此,您不想直接发送任何状态消息;您想要发送一些 JavaScript 来更新页面上现有的状态元素。 (此处为trailingSpan
元素。)Here's an example of code I've just used. It applies a
ThmxTheme
(selectedTheme
) to allSPWebs
in anSPSite
(site
).Note that the current value of
opState.State
is appended to the client's HTML (viaHttpContext.Current.Response.Write
and.Flush
) every second. Thus you don't want to send any status message directly; you want to send some JavaScript that will update an existing status element on the page. (Here, thetrailingSpan
element.)