[英]EntityDataSource with a GridView WHERE Explnation
Hi I use a GridView with an EntityDataSource. 嗨,我将GridView与EntityDataSource一起使用。
I need to FILTER data from EntityDataSource using WHERE. 我需要使用WHERE从EntityDataSource过滤数据。 The Filter should use the ProviderUserKey (GUID DataType in my case) for the Current logged in User. 筛选器应为当前登录用户使用ProviderUserKey(在我的情况下为GUID数据类型)。
At the moment I use to retrive my Guid this code in Page_Load Event 目前,我习惯在Page_Load事件中检索此代码
Guid myActiveUser = (Guid)Membership.GetUser().ProviderUserKey;
Thanks guys! 多谢你们!
Try using the code like the following: 尝试使用如下代码:
Guid myActiveUser = (Guid)Membership.GetUser().ProviderUserKey;
EntityDataSource1.Where = "it.User = " + myActiveUser.ToString();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.