您可以在更新面板中从异步回发切换到完整回发吗?
这样的事情可能吗?
Dim iCounter as Integer
Dim iQuantity as Integer = 10
Protected Sub btnFoo_Click Handles btnFoo Yadda
For i as Integer = iCounter to iQuantity - 1
//do something with AsyncPostBackTrigger until iCounter = iQuantity - 1
//then trigger a full postback
Next
End Sub
我对这个概念很陌生,感觉一定有一些非常简单的东西我错过了。
Is something like this possible?
Dim iCounter as Integer
Dim iQuantity as Integer = 10
Protected Sub btnFoo_Click Handles btnFoo Yadda
For i as Integer = iCounter to iQuantity - 1
//do something with AsyncPostBackTrigger until iCounter = iQuantity - 1
//then trigger a full postback
Next
End Sub
I am new to the concept and feel like there must be something really easy that I am missing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无需深究原因,我最终所做的是将计数器存储在会话变量中,并从 for 循环中退出子程序,除非计数器等于数量。
然后,我需要更新的 for 循环结束后的所有内容(标签、DropDownBoxes)我都放在自己的更新面板中,并将 UpdateMode 设置为始终。
修改上面的伪代码:
也许不是“最佳实践”,但它满足了我的需要。
Without going into why, what I eventually did was store the counter in a session variable and exited the sub from the for loop unless the counter was equal to the quantity.
Then everything past the end of the for loop that I needed updated (Labels, DropDownBoxes) I put in their own update panels with UpdateMode set to always.
To modify my pseudo code above:
Maybe not the 'best practice' but it worked for what I needed.