public class Server
{
...
[Website]
public static Sitelet<object> Main =>
new SiteletBuilder()
.With<Home>((ctx, action) =>
Page(ctx, action, "Home",
doc(
h1("Say Hi to the server!"),
div(client(() => Client.Main())),
new Template.Uploaddialogtemplate()
.sendUTClick((tev) => Client.SendUTClickHandler(tev)) // <-- assigning method to handler-hole
.Elt()
)
)
)
.With<About>((ctx, action) =>
Page(ctx, action, "About",
doc(
h1("About"),
p("This is a template WebSharper client-server application.")
)
)
)
.Install();
}
[JavaScript]
public static class Client
{
...
static public void SendUTClickHandler(WebSharper.UI.Templating.Runtime.Server.TemplateEvent<Template.Uploaddialogtemplate.Vars, WebSharper.JavaScript.Dom.MouseEvent> tev)
{
JS.Alert("test");
}
}
Binding a handler to ws-onclick hole results in exception "Invalid hole, expected quoted event: ".
Stack trace of the exception on startup.