c# - Url.Route in ApiController doesn't include hostname -


from apicontroller, generating password reset link emailed user. works except url.route function doesn't generate link hostname. i'm not sure if it's because i'm using localhost that's causing problem.

this code generate link

string callbackurl  = url.route("defaultapi", new { controller = "account", action= "resetpassword", userid = user.id, code = code }); 

this link generated

https:///api/account/resetpassword?userid=aaaaaaaaaa&code=aaaaaaaaa 

notice https:///api, should include hostname , port https://localhost:4040/api. why isn't hostname being included?

url.route generates relative urls only. absolute url, use url.link:

string callbackurl  = url.link("defaultapi", new { controller = "account", action= "resetpassword", userid = user.id, code = code }); 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -