For this you need to create a Var that will hold your server response, bind it to your template, and then you can set it in your callback:

1
2
3
4
5
6
7
8
9
10
let serverResponse = Var.Create ""

// ... template code:
    .ServerResponse(serverResponse.View) // Display the reactive value of serverResponse
    .Login(fun e ->
        async {
            let! res = Server.LoginClicked e.Vars.Email.Value
            serverResponse.Value <- res
        } |> Async.StartImmediate
    )
By on 5/9/2018 4:53 AM ()

Thanks Loïc,

I found another way as well

1
serverResponse.Set res

is there a preference of one approach over the other Derek

By on 5/13/2018 8:19 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper