gpt4 book ai didi

c# - Asp.net Membership Provider 在 url 中显示登录信息

转载 作者:行者123 更新时间:2023-12-02 05:19:42 24 4
gpt4 key购买 nike

我不确定我做了什么,但现在我的网站显示为 url:

http://localhost:53187/Customer/AccountScreen?UserName=testx&Password=test12345&RememberMe=False&AccountId=5b89d595-ef19-4feb-b95d-bf39672c9ac4

我这样调用客户的帐户屏幕:

return RedirectToAction("AccountScreen", "Customer", model);

所以,我不明白为什么它现在在 url 中显示这个。对我来说,这确实是一种不好的做法。

有没有办法避免这种情况?

最佳答案

不清楚为什么要将模型传递给 RedirectToAction 方法。第三个参数用于 routeValues。

无论您传递给 routeValues 参数什么都会在 url 中公开其属性。把第三个参数去掉就ok了。如果您需要将任何内容传递给 AccountScreen,请使用类似

的内容
return RedirectToAction("AccountScreen", "Customer", new { id = model.Id });

关于c# - Asp.net Membership Provider 在 url 中显示登录信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14086536/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com