在多视图超时中查看

发布于 2024-10-05 04:39:39 字数 81 浏览 9 评论 0原文

基本上我想做的是“超时”视图。类似于一段时间后的 JavaScript 重定向,只不过不是重定向,而是切换到多视图中的不同视图。有人知道该怎么做吗?

Basically what I want to do is "timeout" a view. Similar to a javascript redirect after a certain amount of time except instead of redirecting, switching to a different view in the multiview. Anyone know how to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戏舞 2024-10-12 04:39:39

由于 MultiView 没有客户端 API,因此方法是手动创建一个 __doPostBack 调用,以多视图 ID 作为源:

__doPostBack('<%= multiview.UniqueID %>', 'switch');

第二个参数是事件名称/args;您可以通过以下方式在回发中手动检查这一点:

if (Request.Form["__EVENTTARGET"] != null && 
    Request.Form["__EVENTTARGET"].EndsWith(multiview.ID) && 
    Request.Form["__EVENTARGUMENT"] == "switch")

然后切换当前视图;可能已经有一个内置命令名称可以执行此操作,我不确定。

Since MultiView doesn't have a client-side API, the way to do this is to manually create a __doPostBack call with the multiview ID as the source:

__doPostBack('<%= multiview.UniqueID %>', 'switch');

The second parameter is the event name/args; you can manually check this on the postback via:

if (Request.Form["__EVENTTARGET"] != null && 
    Request.Form["__EVENTTARGET"].EndsWith(multiview.ID) && 
    Request.Form["__EVENTARGUMENT"] == "switch")

And then switch the current view; there may already be a built-in command name to do this, I am not sure of that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文