You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am struggling to implement a redirect with querystring parameters
It seems the controller.Redirect can receive optional parameters which are empty interfaces.
I've tried a few variations on this theme but the parameters never find their way into the URL.
In this example the route defaults to "itemselect" when I would expect "itemselect?id=13&name=aaa"
Anybody know how to implement this correctly?
var queryParam1 interface{} = "id=13"
var queryParam2 interface{} = "name=aaa"
return c.Redirect(ctx, "itemselect", queryParam1, queryParam2)
The text was updated successfully, but these errors were encountered:
The same route params are used in the Page.ToURL which can be called in the templates to generate route links. Using named parameters and this method is better (in my opinion) than hard-coding URLs all over your app.
As for supplying query params to Redirect(), that unfortunately is not currently supported but I don't see a reason why it cannot be added.
I am struggling to implement a redirect with querystring parameters
It seems the controller.Redirect can receive optional parameters which are empty interfaces.
I've tried a few variations on this theme but the parameters never find their way into the URL.
In this example the route defaults to "itemselect" when I would expect "itemselect?id=13&name=aaa"
Anybody know how to implement this correctly?
var queryParam1 interface{} = "id=13"
var queryParam2 interface{} = "name=aaa"
return c.Redirect(ctx, "itemselect", queryParam1, queryParam2)
The text was updated successfully, but these errors were encountered: