4

Hi I would like to ask what is the correct way for redirection from a command in dotVVM framework. I am trying to redirect to another page via Context.Redirect() function that actually works but I get an exception "DotVVM.Framework.Hosting.DotvvmInterruptRequestExecutionException" with additional information "Error in the application" that actually doesn't help and I would like to get rid of it, not just ignoring it. My current code is

DotHTML

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

cs

public void Register()
{
    Context.Redirect("Register");
}
Andrej Dobeš
  • 233
  • 1
  • 4
  • 12

2 Answers2

4

The exception is OK. DotVVM uses exceptions internally to perform the redirects - there is no other reasonable way to do that. Just hit F5 in Visual Studio and it will continue.

Tomáš Herceg
  • 1,595
  • 1
  • 13
  • 18
0

RedirectToRoute is the new name in their API.

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