Ejemplo n.º 1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            int    is3g   = 0;
            string msisdn = MobileUtils.GetMSISDN(out is3g);
            string urlRes = AppEnv.GetSetting("WapDefault") + "/login.aspx";

            if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
            {
                Session["telco"]  = Constant.Constant.T_Vietnamobile;
                Session["msisdn"] = msisdn;
            }
            else
            {
                Session["msisdn"] = null;
                Session["telco"]  = Constant.Constant.T_Undefined;
                Response.Redirect(urlRes);
            }
        }
Ejemplo n.º 2
0
        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";
                }
            }

            if (Session["msisdn"] == null)
            //if (ConvertUtility.ToString(Session["telco"]) == string.Empty)
            {
                int    is3g   = 0;
                string msisdn = MobileUtils.GetMSISDN(out is3g);

                Session["is3g"] = is3g;

                if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                {
                    Session["telco"]  = Constant.Constant.T_Vietnamobile;
                    Session["msisdn"] = msisdn;
                }
                else
                {
                    Session["msisdn"] = null;
                    Session["telco"]  = Constant.Constant.T_Undefined;
                }
            }
        }