protected override void OnInit(EventArgs e) { if (HttpContext.Current.Request.UserAgent.ToLower().Contains("midp") && !MobileUtils.IsBlackBerry(HttpContext.Current.Request.UserAgent.ToLower())) { //Response.CacheControl = "private"; Response.Charset = "UTF-8"; //Response.Expires = 0; string acceptHeader = Request.ServerVariables["HTTP_ACCEPT"]; if (acceptHeader.IndexOf("application/vnd.wap.xhtml+xml") != -1) { Response.ContentType = "application/vnd.wap.xhtml+xml"; } else if (acceptHeader.IndexOf("application/xhtml+xml") != -1) { Response.ContentType = "application/xhtml+xml"; } else { Response.ContentType = "text/html"; } } }