none
asp.net默认不使用session了,请问如何使用cookie在母版页中显示登陆用户信息? RRS feed

全部回复

  • Hi,

    有关ASP.NET的问题我建议你直接到ASP.NET Forum提问。那里会提供更加专业的回复。

    感谢您的理解!

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2019年9月19日 1:37
  • 可惜那是英文的啊
    2019年9月19日 1:40
  • Hi,

    我帮你把问题移动到了ASP.NET的中文子版块,或许有人可以帮助你。

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2019年9月19日 1:43
  • 你好,

    据我所知,如果你想要在ASP.NET Core里面使用session,你必须要先在startup.cs里面先启用session对应的middleware,然后才能在页面里面使用session。

    至于如何在View或者razor page里面调用session。我建议你可以参考如下链接:

    https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/app-state?view=aspnetcore-2.2#configure-session-state 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2019年9月19日 8:19