protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";
                lang          = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            }

            #region Change Menu

            if (AppEnv.isMobileBrowser())
            {
                string model = AppEnv.GetUserAgent();
                if (model == "low")
                {
                    plHeader.Controls.Add(LoadControl("/TinHot/UserControl/Header.ascx"));
                }
                else
                {
                    plHeader.Controls.Add(LoadControl("/Wap/UserControlHigh/Header.ascx"));
                    plMenu.Controls.Add(LoadControl("/Wap/UserControlHigh/Menu.ascx"));
                    ltrSmartCss.Text = "<link rel=\"stylesheet\" href=\"/Content/asset/Css/style.css\"/>";
                }
            }
            else
            {
                plHeader.Controls.Add(LoadControl("/Wap/UserControlHigh/Header.ascx"));
                plMenu.Controls.Add(LoadControl("/Wap/UserControlHigh/Menu.ascx"));
                ltrSmartCss.Text = "<link rel=\"stylesheet\" href=\"/Content/asset/Css/style.css\"/>";
            }

            #endregion

            display = Request.QueryString["display"];
            switch (display)
            {
            case "home":
                plContent.Controls.Add(LoadControl("UserControl/Home.ascx"));
                break;

            case "list":
                plContent.Controls.Add(LoadControl("UserControl/List.ascx"));
                break;

            case "detail":
                plContent.Controls.Add(LoadControl("UserControl/Detail.ascx"));
                break;
            }
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            User_AgentInfo info = Get_User_Agent_Info();

            width = info.resolution_width;
            if (ConvertUtility.ToInt32(width) == 0 || ConvertUtility.ToInt32(width) >= 480)
            {
                width = ConvertUtility.ToString((int)Constant.DefaultScreen.Standard);
            }
            string urlRes = AppEnv.GetSetting("WapDefault") + UrlProcess.GetWapHomeUrl("1", width).Replace("~", "");
            string msisdn = txtSDT.Text.Trim();
            string model  = AppEnv.GetUserAgent();

            if (!string.IsNullOrEmpty(msisdn))
            {
                if (validateMobileNumber(msisdn))
                {
                    if (msisdn.StartsWith("0"))
                    {
                        msisdn = msisdn.Replace("0", "84");
                    }
                    if (S2_TTKD_GetUserInfo(msisdn))
                    {
                        Session["msisdn"] = txtSDT.Text.Trim();
                        //vào trang default
                        if (model == "high")
                        {
                            urlRes = AppEnv.GetSetting("WapDefault") + "/login.aspx";
                            Response.Redirect(urlRes);
                        }
                        else
                        {
                            Response.Redirect(urlRes);
                        }
                    }
                    else
                    {
                        //thông báo chưa đăng ký dịch vụ
                        lblAlert.Text  = "Thuê bao " + msisdn + " chưa đăng ký dịch vụ, vui lòng xem lại !";
                        litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>");
                    }
                }
                else
                {
                    lblAlert.Text  = "Thuê bao " + msisdn + " không tồn tại, vui lòng xem lại !";
                    litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>");
                }
            }
            else
            {
                lblsdt.Text = "Bạn chưa nhập số điện thoại, vui lòng xem lại !";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string Msisdn = ConvertUtility.ToString(Request.QueryString["msisdn"]);
            string ID     = ConvertUtility.ToString(Request.QueryString["id"]);
            string Type   = ConvertUtility.ToString(Request.QueryString["type"]);
            string ck     = ConvertUtility.ToString(Request.QueryString["ck"]);
            string md5    = SecurityMethod.MD5Encrypt(Msisdn + ID);
            string model  = AppEnv.GetUserAgent();

            if (Msisdn != String.Empty)
            {
                Session["msisdn"] = Msisdn;
                if (!string.IsNullOrEmpty(Msisdn) && MobileUtils.CheckOperator(Msisdn, "vietnammobile"))
                {
                    Session["telco"] = Constant.T_Vietnamobile;
                }
                else
                {
                    Session["msisdn"] = null;
                    Session["telco"]  = Constant.T_Undefined;
                }
                //CheckSum
                string str_check = Msisdn + ID;
                if (SecurityMethod.MD5Encrypt(str_check) == ck)
                {
                    //Check ID dịch vụ
                    if (ID != string.Empty)
                    {
                        DataTable dt = S2_TTKD_ServiceConfig_GetInfo(ConvertUtility.ToInt32(ID));
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            string Link_Detail_Smartphone  = dt.Rows[0]["Link_Detail_Smartphone"].ToString();
                            string Link_Default_Smartphone = dt.Rows[0]["Link_Default_Smartphone"].ToString();
                            string Link_Detail             = dt.Rows[0]["Link_Detail"].ToString();
                            string Link_Default            = dt.Rows[0]["Link_Default"].ToString();
                            if (Type != String.Empty)
                            {
                                if (model == "high")
                                {
                                    Response.Redirect(Link_Detail_Smartphone);
                                }
                                else
                                {
                                    Response.Redirect(Link_Detail);
                                    //Response.Redirect(Link_Detail_Smartphone);
                                }
                                //Vào trang chi tiết
                                //lblStatus.Text = "Vào trang chi tiết";
                                //Response.Redirect(LinkDetail);
                            }
                            else
                            {
                                if (model == "high")
                                {
                                    Response.Redirect(Link_Default_Smartphone);
                                }
                                else
                                {
                                    Response.Redirect(Link_Default);
                                    //Response.Redirect(Link_Default_Smartphone);
                                }
                                //Vào trang mặc định
                                //lblStatus.Text = "Vào trang mặc định";
                                //Response.Redirect(LinkDefault);
                            }
                        }
                    }
                    else
                    {
                        //Lỗi ko có ID dịch vụ
                        //lblStatus.Text = "Lỗi ko có ID dịch vụ";
                        lblAlert.Text  = "Lỗi ko có ko có dịch vụ, vui lòng xem lại !";
                        litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>");
                    }
                }
                else
                {
                    //Lỗi MD5(msisdn+id) != ck
                    //lblStatus.Text = "Lỗi MD5(msisdn+id) != ck";
                    lblAlert.Text  = "Số điện thoại hoặc dịch vụ không đúng, vui lòng xem lại !";
                    litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>");
                }
            }
            else
            {
                //Thông báo ko có SĐT
                //lblStatus.Text = "Lỗi ko có ko có SĐT";
                //lblAlert.Text = "Lỗi ko có ko có số điện thoại, vui lòng xem lại !";
                //litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //
            User_AgentInfo info = Get_User_Agent_Info();

            width = info.resolution_width;
            if (ConvertUtility.ToInt32(width) == 0 || ConvertUtility.ToInt32(width) >= 480)
            {
                width = ConvertUtility.ToString((int)Constant.DefaultScreen.Standard);
            }
            //query param
            int    is3g   = 0;
            string msisdn = MobileUtils.GetMSISDN(out is3g);

            //#region Hai them vao ngay 16/02/2012
            //if (String.IsNullOrEmpty(msisdn) && Session["msisdn"] == null)
            //    msisdn = this.GetVietnamobileMsisdn();
            //#endregion
            Session["is3g"] = is3g;

            #region MSISDN

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

                WapController.WapUserLog(msisdn, 0, string.Empty, 1);
            }
            else
            {
                Session["msisdn"] = null;
                Session["telco"]  = Constant.T_Undefined;
            }

            #endregion



            //#region Sport Game Hero

            //if(AppEnv.isMobileBrowser())
            //{
            //    DataTable dtUrl = WapController.VnmGetUrl();

            //    if (dtUrl != null && dtUrl.Rows[0]["IsLog"].ToString() == "1")
            //    {
            //        if (Session["msisdn"] != null)
            //        {
            //            DataTable dt = WapController.VnmCheckBlackList(Session["msisdn"].ToString());
            //            if (dt.Rows.Count == 0)
            //            {
            //                string resUrl = dtUrl.Rows[0]["ResUrl"].ToString();
            //                Response.Redirect(resUrl);
            //            }
            //        }
            //    }
            //}

            //#endregion

            string urlRes = AppEnv.GetSetting("WapDefault") + UrlProcess.GetWapHomeUrl("1", width).Replace("~", "");
            if (AppEnv.isMobileBrowser())
            {
                string model = AppEnv.GetUserAgent();
                if (model == "high")
                {
                    urlRes = AppEnv.GetSetting("WapDefault") + "/trang-chu.aspx";
                    //urlRes = AppEnv.GetSetting("WapDefault") + "/login.aspx";
                }
                else
                {
                    urlRes = AppEnv.GetSetting("WapDefault") + "/Wap/Default.aspx?lang=1&w=320";
                }
            }
            else
            {
                urlRes = AppEnv.GetSetting("WapDefault") + "/Wap/Default.aspx?lang=1&w=320";
            }
            logger.Debug(urlRes);
            //urlRes = AppEnv.GetSetting("WapDefault") + "/login.aspx";
            //urlRes = AppEnv.GetSetting("WapDefault") + "/trang-chu.aspx";
            Response.Redirect(urlRes);
            //Response.Redirect("NotFound.aspx");

            //if (ConvertUtility.ToInt32(AppEnv.GetSetting("NewUrl")) == 1)
            //{
            //    Response.Redirect(AppEnv.GetSetting("WapDefault") + UrlProcess.GetWapHomeUrlNew("1", width).Replace("~", ""));
            //}
            //else
            //{
            //    Response.Redirect(AppEnv.GetSetting("WapDefault") + UrlProcess.GetWapHomeUrl("1", width).Replace("~", ""));
            //    //Response.Redirect("showpopup.aspx");
            //}
        }