0

我的 Web 应用程序中有一个扩展名为 .net 控件的网格面板。现在网格面板与 Store 绑定。我已经加密了登录用户名,数据库存储了加密的登录名。现在我希望网格面板在字段中显示实际解密的数据。但我不知道在扩展 .net 控件中构建网格数据期间在哪里解密。请帮忙。

4

1 回答 1

0

在绑定 Source 的数据源之前,我只是像rowbounddata事件一样调用了 Db 数据的 for 循环,并在其中解密了我的列(字段)数据。最后绑定最新的数据源

for (int i = 0; i < this.getUserList(this.getUserFilter()).Count; i++)
{
  this.getUserList(this.getUserFilter())[i].LoginName = CommonUtilities.Decrypt(this.getUserList(this.getUserFilter())[i].LoginName, ConfigurationManager.AppSettings["EightCharacterEncryptionKey"]);
}
this.Store1.DataSource = this.getUserList(this.getUserFilter());
this.Store1.DataBind();
于 2012-12-06T11:33:03.420 回答