4

嗨,我想问从 dotVVM 框架中的命令重定向的正确方法是什么。我正在尝试通过实际有效的 Context.Redirect() 函数重定向到另一个页面,但我得到一个异常“DotVVM.Framework.Hosting.DotvvmInterruptRequestExecutionException”,附加信息“应用程序中的错误”实际上没有帮助,我会喜欢摆脱它,而不仅仅是忽略它。我目前的代码是

点HTML

<dot:Button Click="{command: Register()}" Text="Register" class="register-button" />

CS

public void Register()
{
    Context.Redirect("Register");
}
4

2 回答 2

4

例外是好的。DotVVM 在内部使用异常来执行重定向——没有其他合理的方法可以做到这一点。只需在 Visual Studio 中按 F5 即可继续。

于 2015-10-12T09:37:09.937 回答
0

RedirectToRoute is the new name in their API.

I notice that calling RedirectToRoute in an async command doesn't produce this behavior.

于 2017-09-15T16:33:45.060 回答