【发布时间】:2014-11-18 10:07:12
【问题描述】:
我正在为基于团队的游戏创建一个 Web 应用程序。这是场景:
1. First we enter the participants ID. After entering an ID
the user clicks save button and the same is displayed in a gridview below.
This way we enter multiple IDs and all of them are added in the gridview.
2. Then we click shuffle and the inserted IDs are shuffled.
我已经有了第二部分的逻辑。但我无法一个接一个地存储 ID。 我想知道为该会话存储 ID 的最佳方式是什么。我不想使用任何外部数据库。我已经尝试过列表、数组、字典、数据表等,但是一旦用户插入 ID 并单击保存,页面重新加载并且新数据覆盖旧数据并且只显示一个 ID在网格视图中。任何人都可以提出实现这一目标的最佳方法吗?
【问题讨论】:
-
如果不需要持久性,将它们存储在会话中,如果您希望 ID 保留在会话/用户之间而不使用数据库,那么您可以使用文件(可能是 csv 的 ID) .
标签: c# asp.net gridview datatable