使用 AsynchPostBack 捕获请求?

发布于 2024-12-15 06:29:58 字数 481 浏览 2 评论 0原文

使用异步回发时是否可以捕获请求?

我正在做以下事情。在我的主文件中,我的网站上有 2 个用于 2 种语言的按钮。

ScriptManager1.RegisterPostBackControl(linkFR)
ScriptManager1.RegisterPostBackControl(linkNL)

我在每个页面中继承一个名为语言的类。我这里看看有没有请求。如果有请求,请查看目标的 controlID 并获取网站的正确资源文件。

If Request(PostBackEventTarget) IsNot Nothing Then
  Dim controlID As String = Request(PostBackEventTarget)

当我让页面刷新时,这有效,但使用 asyncpostback 时不会发送请求

是否有另一种方法来捕获 asyncpostback?

Is it possible to catch a request when using an asynchpostback?

I'm doing the following. In my masterfile I have 2 buttons for the 2 languages on my site.

ScriptManager1.RegisterPostBackControl(linkFR)
ScriptManager1.RegisterPostBackControl(linkNL)

I Inherit a class called language in each page. Here I look if there is a request or not. If there is a request look at the controlID of the target and get the correct resourcefile for the website.

If Request(PostBackEventTarget) IsNot Nothing Then
  Dim controlID As String = Request(PostBackEventTarget)

This works when I let the page refresh, but with asyncpostback no request is sent

Is there another method to catch an asyncpostback?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文