Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%-- il CookiesID deve sempre iniziare per DevExpress_ ed essere diverso per ciascuna griglia del sito dove lo si utilizza
- Bisogna anche aggiungere l'evento Session_Start nel global.asax--%>
- <SettingsCookies Enabled="True" CookiesID="DevExpress_NOMEGRIGLIA" StoreColumnsVisiblePosition="True" StoreColumnsWidth="True" StoreFiltering="True" StoreGroupingAndSorting="True" StorePaging="True" />
- void Session_Start(object sender, EventArgs e)
- {
- base.Application_AuthenticateRequest(sender, e);
- if (Context.User != null &&
- (Context.User.IsInRole(Role.AdminRoleName) || Context.User.IsInRole(Role.ProsperoRoleName)))
- {
- var keyColl = Context.Request.Cookies.AllKeys;
- for (int i=0;i<keyColl.Length;i++)
- {
- if (keyColl[i].StartsWith("DevExpress_",StringComparison.OrdinalIgnoreCase))
- {
- var httpCookie = Context.Request.Cookies[keyColl[i]];
- if (httpCookie != null)
- {
- httpCookie.Expires = DateTime.Now.AddDays(-1);
- Context.Response.Cookies.Add(httpCookie);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment