asp.net - Asp.net - 如何为每个用户创建一个页面
问题描述
基本上我想要一个可以看到用户详细信息的页面。喜欢 twitter 或 facebook 个人资料页面。
解决方案
设计一个html页面。例如,Profile.cshtml 文件。发送登录到此页面的用户信息,并将此数据写入您要设置的位置。
public ActionResult Profile()
{
ViewBag.User = User;
return View();
}
html之间以这种方式实现
<div>@ViewBag.User.Name</div>
推荐阅读
- google-cloud-platform - Google Cloud Storage 中的 daisy-bkt 存储桶是什么?
- apache-spark - pyspark中的动态字典
- python-3.x - 使用 TensorFlow matmul 时出现意外结果,dtype=tf.float32
- javascript - 从 url 获取(),无法访问对象,console.log()有效
- javascript - 在 JS 中声明多个私有类方法时,我收到 ESLINT 警告,为什么?
- css - Flexbox - 菜单项在小屏幕上移动到第二行
- discord.py - 未连接到语音
- excel - Excel VBA 不会保存:创建 8 位字母数字“文件名”
- c - 是否有选择嵌入结构本身或指向结构内的结构的指针的原则?
- quarkus - 使用 Panache 自定义查询 REST 数据