Esempio n. 1
0
  protected override void OnLoad(EventArgs e)
  {
    string customStyleSheet = AppSettings.CustomStyleSheet;

    if (!String.IsNullOrEmpty(customStyleSheet))
    {
      HtmlHead head = FindControl("head") as HtmlHead;

      if (head == null && Master != null)
      {
        head = Master.FindControl("head") as HtmlHead;
      }

      if (head != null)
      {
        if (AppRelativeVirtualPath.StartsWith("~/Admin/") && customStyleSheet.ToLower().StartsWith("styles/"))
        {
          customStyleSheet = "../" + customStyleSheet;
        }

        HtmlLink customLink = new HtmlLink();
        head.Controls.Add(customLink);
        customLink.Href = customStyleSheet;
        customLink.Attributes["type"] = "text/css";
        customLink.Attributes["rel"] = "Stylesheet";
      }
    }

    base.OnLoad(e);
  }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/EventUpdate.aspx";
        head.Controls.AddAt(0, lk);

        HtmlMeta hm = new HtmlMeta();
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, NOFOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Response.Redirect("~/Home.aspx");
        if (Session["User"] == null)
        {
            Response.Redirect("~/Home.aspx");
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        DataSet dsEvent = dat.GetData("SELECT * FROM Events WHERE ID="+Request.QueryString["ID"].ToString());

        nameLabel.Text = "Enter an update for the event ' " + dsEvent.Tables[0].Rows[0]["Header"].ToString() +" '";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/EventCommunicate.aspx";
        head.Controls.AddAt(0, lk);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }

        YesButton.SERVER_CLICK += SaveSettingsDB;

        if (!IsPostBack)
        {
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            try
            {
                if (Session["User"] != null)
                {
                    DoUser();
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Eucalypto.Wiki.Category category = Eucalypto.Wiki.WikiManager.GetCategoryByName(CategoryName, true);

        if (Eucalypto.SecurityHelper.CanRead(Page.User, category, null) == false)
            throw new Eucalypto.InvalidPermissionException("read category");

        lblDisplayName.InnerText = category.DisplayName;
        lblDescription.InnerText = category.Description;

        HtmlLink link = new HtmlLink();
        link.Href = Navigation.Wiki_CategoryRss(CategoryName).GetServerUrl(true);
        link.Attributes.Add("rel", "alternate");
        link.Attributes.Add("type", "application/rss+xml");
        link.Attributes.Add("title", "Category " + category.DisplayName + " News");
        Header.Controls.Add(link);

        linkNew.HRef = Navigation.Wiki_NewArticle(CategoryName).GetServerUrl(true);

        linkRss.HRef = Navigation.Wiki_CategoryRss(CategoryName).GetServerUrl(true);

        linkNew.Visible = Eucalypto.SecurityHelper.CanInsert(Page.User, category);

        linkSearch.HRef = Navigation.Wiki_Search().GetServerUrl(true);

        LoadList(category);
    }
Esempio n. 5
0
  protected void Page_Init(object sender, EventArgs e)
  {
    // reference minified stylesheets

    DateTime lastWriteTime = MinifiedStylesheetsHandler.GetLastWriteTime();

    HtmlLink link = new HtmlLink();
    link.Attributes["type"] = "text/css";
    link.Attributes["rel"] ="stylesheet";
    link.Href = "Styles/MinifiedStylesheets.ashx" + GetCacheControl(lastWriteTime) + "&ext=.css";
    head.Controls.Add(link);

    // reference minified scripts if not in debug mode

    if (System.Diagnostics.Debugger.IsAttached)
    {
      string query = AppSettings.AllowDevScriptCaching ? "" : GetCacheControl();

      foreach (ScriptItem scriptItem in MinifiedScriptsHandler.GetList())
      {
        head.Controls.Add(MakeScriptReference(scriptItem.FileName + query));
      }
    }
    else
    {
      lastWriteTime = MinifiedScriptsHandler.GetLastWriteTime();
      head.Controls.Add(MakeScriptReference("Scripts/MinifiedScripts.ashx" + GetCacheControl(lastWriteTime) + "&ext=.js"));
    }

    _config = AppContext.GetConfiguration();
	}
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Eucalypto.Forum.Category category = Eucalypto.Forum.ForumManager.GetCategoryByName(ForumName, true);
        if (Eucalypto.SecurityHelper.CanRead(Page.User, category, null) == false)
            throw new Eucalypto.InvalidPermissionException("read forum");

        HtmlLink link = new HtmlLink();
        link.Href = Navigation.Forum_ForumRss(ForumName).GetServerUrl(true);
        link.Attributes.Add("rel", "alternate");
        link.Attributes.Add("type", "application/rss+xml");
        link.Attributes.Add("title", "Forum " + category.DisplayName + " News");
        Header.Controls.Add(link);

        linkNewTopic.HRef = Navigation.Forum_NewTopic(ForumName).GetServerUrl(true);
        linkRss.HRef = Navigation.Forum_ForumRss(ForumName).GetServerUrl(true);

        lblForumName.InnerText = category.DisplayName;
        lblDescription.InnerText = category.Description;

        linkNewTopic.Visible = Eucalypto.SecurityHelper.CanInsert(Page.User, category);

        linkSearch.HRef = Navigation.Forum_Search().GetServerUrl(true);

        topicList.CategoryName = ForumName;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/InviteFriendAlert.aspx";
        head.Controls.AddAt(0, lk);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }

        ASP.controls_bluebutton_ascx SendButton = (ASP.controls_bluebutton_ascx)SearchPanel.Items[0].Items[0].FindControl("SendButton");

        SendButton.SERVER_CLICK = SendIt;

        Label MessageLabel = (Label)SearchPanel.Items[0].Items[0].FindControl("MessageLabel");
        MessageLabel.Text = "";
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            try
            {
                if (Session["User"] != null)
                {
                    int count = 0;
                    if (Infolabel.Text != "")
                    {
                        count = int.Parse(Infolabel.Text);
                    }
                    else
                    {
                        count = 5;
                        Infolabel.Text = "5";
                    }
                    Panel FriendPanel = (Panel)SearchPanel.Items[0].Items[0].FindControl("FriendPanel");
                    FriendPanel.Controls.Clear();
                    TextBox text;
                    for (int i = 1; i <= count; i++)
                    {
                        text = new TextBox();
                        text.ID = "text" + i.ToString();
                        text.Width = 250;

                        FriendPanel.Controls.Add(text);
                    }
                }
                else
                {
                    Response.Redirect("login");
                }
            }
            catch (Exception ex)
            {
            }
    }
 protected void AddLinkedStyle(string url)
 {
     HtmlLink hLink = new HtmlLink();
     hLink.Attributes.Add("type", "text/css");
     hLink.Attributes.Add("rel", "stylesheet");
     hLink.Attributes.Add("href", url);
     Page.Header.Controls.Add(hLink);
 }
Esempio n. 9
0
 public void AddStyleSheet(Page page, string cssPath)
 {
     HtmlLink link = new HtmlLink();
     link.Href = cssPath;
     link.Attributes["rel"] = "stylesheet";
     link.Attributes["type"] = "text/css";
     page.Header.Controls.Add(link);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     HtmlHead head = (HtmlHead)Page.Header;
     HtmlLink lk = new HtmlLink();
     lk.Href = "http://" + Request.Url.Authority + "/ProhibitedAds.aspx";
     lk.Attributes.Add("rel", "bookmark");
     head.Controls.AddAt(0, lk);
 }
Esempio n. 11
0
    public static void AddStyleSheet(HtmlHead header, string cssPath)
    {
        HtmlLink lnk = new HtmlLink();
        lnk.Href = cssPath;
        lnk.Attributes["text"] = "text/css";
        lnk.Attributes["rel"] = "stylesheet";

        header.Controls.Add(lnk);
    }
Esempio n. 12
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        HtmlLink link = new HtmlLink();
        link.Href = "CustomStyles.css";
        link.Attributes.Add("rel", "stylesheet");
        link.Attributes.Add("type", "text/css");

        Header.Controls.Add(link);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/RateExperience.aspx";
        head.Controls.AddAt(0, lk);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        //string cookieName = FormsAuthentication.FormsCookieName;
        //HttpCookie authCookie = Context.Request.Cookies[cookieName];

        //FormsAuthenticationTicket authTicket = null;

        SubmitButton.SERVER_CLICK = SendIt;
        try
        {
            //string group = "";
            //if (authCookie != null)
            //{
            //    authTicket = FormsAuthentication.Decrypt(authCookie.Value);
            //    group = authTicket.UserData.ToString();
            //}

            if (Request.QueryString["ID"] != null & Request.QueryString["Type"] != null)
            {
                //Session["User"] = authTicket.Name;
                //DataSet ds1 = dat.GetData("SELECT UserName FROM Users WHERE User_ID=" + authTicket.Name);
                //Session["UserName"] = ds1.Tables[0].Rows[0]["UserName"].ToString();
                LoggedInPanel.Visible = true;
                LogInPanel.Visible = false;

                //DataSet ds2 = dat.RetrieveAds(Session["User"].ToString(), false);
            }
            else
            {
                Response.Redirect("home");
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("home");
        }

        if (Request.QueryString["ID"] == null || Request.QueryString["Type"] == null)
        {
            Response.Redirect("home");
        }
    }
Esempio n. 14
0
 protected void setupStyle()
 {
     HtmlLink style;
     style = new HtmlLink();
     style.Href = "~/FO_Style/personalistico.css";
     style.Attributes.Add("media", "screen");
     style.Attributes.Add("type", "text/css");
     style.Attributes.Add("rel", "stylesheet");
     Header.Controls.Add(style);
 }
Esempio n. 15
0
 protected override void OnInit(EventArgs e)
 {
     System.Web.UI.Page pg = (System.Web.UI.Page)HttpContext.Current.CurrentHandler;
     HtmlLink link = new HtmlLink();
     link.Attributes.Add("href", "stylePage.css");
     link.Attributes.Add("media", "screen");
     link.Attributes.Add("rel", "stylesheet");
     link.Attributes.Add("type", "text/css");
     pg.Header.Controls.Add(link);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HtmlLink lk = new HtmlLink();
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/HippoPointsEdit.aspx";
        head.Controls.AddAt(0, lk);

        UploadButton.SERVER_CLICK += UploadPick;
        PictureNixItButton.SERVER_CLICK += NixIt;
        BlueButton2.SERVER_CLICK += Save;

        ErrorLabel.Text = "";

        Literal lit = new Literal();
        lit.Text = dat.GetDataDV("SELECT * FROM HippoPointsConditions")[0]["Content"].ToString();

        TACTextBox.Controls.Add(lit);

        if (!IsPostBack)
        {
            DataView dvUser = dat.GetDataDV("SELECT * FROM UserPreferences UP WHERE UP.UserID=" + Session["User"].ToString());

            if(dvUser[0]["MayorText"].ToString().Trim() != "")
                DescriptionTextBox.Text = dvUser[0]["MayorText"].ToString();

            Checkbox1.Checked = bool.Parse(dvUser[0]["Mayors"].ToString());

            if (dvUser[0]["PictureName"].ToString().Trim() != "")
            {
                TheImage.ImageUrl = dvUser[0]["PictureName"].ToString();
                PictureNixItButton.Visible = true;
            }

            if (dvUser[0]["MayorLink"].ToString().Trim() != "")
            {
                LinkTextBox.Text = dvUser[0]["MayorLink"].ToString();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SignInButton.SERVER_CLICK += MakeItSo;
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/ResetPassword.aspx";
        head.Controls.AddAt(0, lk);

        HtmlMeta hm = new HtmlMeta();
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        //Ads1.DATA_SET = dat.RetrieveAllAds(false);
        //Ads1.MAIN_AD_DATA_SET = dat.RetrieveAllAds(true);
        if (Request.QueryString["CODE"] == null || Request.QueryString["UserName"] == null)
        {
            Response.Redirect("home");
        }
        else
        {
            SqlDbType[] types = { SqlDbType.NVarChar };
            object[] parameters = { Request.QueryString["UserName"].ToString() };
            DataSet ds = dat.GetDataWithParemeters("SELECT * FROM Users WHERE UserName=@p0", types, parameters);

            bool isNot = false;
            if (ds.Tables.Count > 0)
                if (ds.Tables[0].Rows.Count > 0)
                {
                    string code = ds.Tables[0].Rows[0]["PasswordReset"].ToString();
                    if (code != Request.QueryString["CODE"].ToString())
                        Response.Redirect("home");
                    else
                    {
                        UserLabel.Text = Request.QueryString["UserName"].ToString();
                    }
                }
                else
                    isNot = true;
            else
                isNot = true;

        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }

        string cookieName = FormsAuthentication.FormsCookieName;
        HttpCookie authCookie = Context.Request.Cookies[cookieName];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        FormsAuthenticationTicket authTicket = null;
        try
        {
            HtmlHead head = (HtmlHead)Page.Header;
            HtmlLink lk = new HtmlLink();
            lk.Href = "http://" + Request.Url.Authority + "/EnterEvent.aspx";
            lk.Attributes.Add("rel", "bookmark");
            head.Controls.AddAt(0, lk);

            EventTitle.Text = "<a  style=\"text-decoration: none; color: white;\" href=\"http://" + Request.Url.Authority + "/EnterEvent.aspx\" >Event Blogging</a>";

            string group = "";
            if (authCookie != null)
            {
                authTicket = FormsAuthentication.Decrypt(authCookie.Value);
                group = authTicket.UserData.ToString();
            }
            Session["RedirectTo"] = "EnterEvent.aspx";
            if (group.Contains("User"))
            {
                Session["User"] = authTicket.Name;
                WelcomeLabel.Text = "On Hippo Happenings, the users have all the power to post events, ads and venues alike. " +
                    "Having an account with us also allows you to do many other things. You're able to add events to your calendar, communicate with others going to events, add your friends, filter content based on your preferences, " +
                    " feature your ads thoughout the site and much more. <br/><br/>So let's go <a class=\"AddLink\" style=\"font-size: 16px;\" href=\"BlogEvent.aspx\">Blog an Event!</a>";
            }
            else
            {
                WelcomeLabel.Text = "On Hippo Happenings, the users have all the power to post events, ads and venues alike. In order to do so, and for us to maintain clean and manageable content,  "
                    + " we require that you <a class=\"AddLink\" href=\"Register.aspx\">create an account</a> with us. <a class=\"AddLink\" href=\"UserLogin.aspx\">Log in</a> if you have an account already. " +
                    "Having an account with us will allow you to do many other things as well. You'll will be able to add events to your calendar, communicate with others going to events, add your friends, filter content based on your preferences, " +
                    " feature your ads thoughout the site and much more. <br/><br/>So let's go <a class=\"AddLink\" style=\"font-size: 16px;\" href=\"Register.aspx\">Register!</a>";
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("~/UserLogin.aspx");
        }
    }
Esempio n. 19
0
    void Page_Init(object sender, EventArgs e)
    {
        // Create an instance of HtmlLink.
        HtmlLink myHtmlLink = new HtmlLink();

        myHtmlLink.Href = "StyleSheet.css";
        myHtmlLink.Attributes.Add("rel", "stylesheet");
        myHtmlLink.Attributes.Add("type", "text/css");

        // Add the instance of HtmlLink to the <HEAD> section of the page.
        head1.Controls.Add(myHtmlLink);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/Feedback.aspx";
        head.Controls.AddAt(0, lk);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        string cookieName = FormsAuthentication.FormsCookieName;
        HttpCookie authCookie = Context.Request.Cookies[cookieName];

        //Button button = (Button)dat.FindControlRecursive(this, "Button1");
        //button.CssClass = "NavBarImageFeedbackSelected";

        FormsAuthenticationTicket authTicket = null;
        try
        {
            Session["RedirectTo"] = Request.Url.AbsoluteUri;
            string group = "";
            if (authCookie != null)
            {
                authTicket = FormsAuthentication.Decrypt(authCookie.Value);
                group = authTicket.UserData.ToString();
            }

            if (group.Contains("User"))
            {
                Session["User"] = authTicket.Name;
                DataSet ds1 = dat.GetData("SELECT UserName FROM Users WHERE User_ID=" + authTicket.Name);
                Session["UserName"] = ds1.Tables[0].Rows[0]["UserName"].ToString();
                LoggedInPanel.Visible = true;
                LogInPanel.Visible = false;
                DataSet ds2 = dat.RetrieveAds(Session["User"].ToString(), false);
            }
            else
            {
                LoggedInPanel.Visible = false;
                LogInPanel.Visible = true;
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 21
0
        public void loadCSS(System.Web.UI.Page p)
        {
            HtmlLink myHtmlLink = new HtmlLink();

            myHtmlLink.Href = "~/App.Styles/Pooling.css";
            myHtmlLink.Attributes.Add("rel", "stylesheet");
            myHtmlLink.Attributes.Add("type", "text/css");
            if (p.Header != null)
            {
                p.Header.Controls.Add(myHtmlLink);
            }
        }
        public static void RegisterHeaderCSS(string url, Page oPage)
        {
            HtmlLink css = new HtmlLink();

            css.Href = url;
            css.Attributes.Add("rel", "stylesheet");
            css.Attributes.Add("type", "text/css");
            if (!oPage.Header.Controls.Contains(css))
            {
                oPage.Header.Controls.Add(css);
            }
        }
        private void LoadAssets()
        {
            HtmlLink Searchcss = new HtmlLink();

            Searchcss.Href = Root.Domain + "/Search/CSS/search.css";
            Searchcss.Attributes["rel"]   = "stylesheet";
            Searchcss.Attributes["type"]  = "text/css";
            Searchcss.Attributes["media"] = "all";
            Page.Header.Controls.Add(Searchcss);

            HtmlLink Activitycss = new HtmlLink();

            Activitycss.Href = Root.Domain + "/Activity/CSS/activity.css";
            Activitycss.Attributes["rel"]   = "stylesheet";
            Activitycss.Attributes["type"]  = "text/css";
            Activitycss.Attributes["media"] = "all";
            Page.Header.Controls.Add(Activitycss);

            HtmlLink Checkboxcss = new HtmlLink();

            Checkboxcss.Href = Root.Domain + "/Search/CSS/comboTreeCheck.css";
            Checkboxcss.Attributes["rel"]   = "stylesheet";
            Checkboxcss.Attributes["type"]  = "text/css";
            Checkboxcss.Attributes["media"] = "all";
            Page.Header.Controls.Add(Checkboxcss);

            HtmlLink publicationscss = new HtmlLink();

            publicationscss.Href = Root.Domain + "/Profile/Modules/CustomViewAuthorInAuthorship/CustomViewAuthorInAuthorship.css";
            publicationscss.Attributes["rel"]   = "stylesheet";
            publicationscss.Attributes["type"]  = "text/css";
            publicationscss.Attributes["media"] = "all";
            Page.Header.Controls.Add(publicationscss);

            //HtmlGenericControl jsscript = new HtmlGenericControl("script");
            //jsscript.Attributes.Add("type", "text/javascript");
            //jsscript.Attributes.Add("src", Root.Domain + "/Search/JavaScript/comboTreeCheck.js");
            //Page.Header.Controls.Add(jsscript);

            // Inject script into HEADER
            Literal script = new Literal();

            script.Text = "<script>var _path = \"" + Root.Domain + "\";</script>";
            Page.Header.Controls.Add(script);


            HtmlGenericControl stats_jsapi = new HtmlGenericControl("script");

            stats_jsapi.Attributes.Add("type", "text/javascript");
            stats_jsapi.Attributes.Add("src", "https://www.gstatic.com/charts/loader.js");
            Page.Header.Controls.Add(stats_jsapi);
        }
Esempio n. 24
0
        private void SetupStyle()
        {
            if (MenuStyle != MenuStyles.None)
            {
                if (Page.Header == null)
                {
                    throw new NullReferenceException("The head html element for the page requires the runat=server property.");
                }

                this.CssClass = "MBMenu"
                                + " MBMenu-" + MenuStyle.ToString();

                if (!HttpContext.Current.Items.Contains("MBMenuBase"))
                {
                    HtmlLink link = new HtmlLink();

                    Page.Header.Controls.Add(link);

                    link.Href = Page.ClientScript.GetWebResourceUrl(
                        typeof(MenuBar),
                        "NCI.Web.UI.WebControls.Menus.Resources.MenuBar.MBMenuBase.css");

                    link.Attributes.Add("rel", "stylesheet");



                    //Mark that the stylesheet has been added so no other
                    //context menus will add this...
                    HttpContext.Current.Items.Add("MBMenuBase", true);
                }

                //If we have not added the stylesheet for this style to the
                //Head block for this request then add it
                if (!HttpContext.Current.Items.Contains(MenuStyle))
                {
                    HtmlLink link = new HtmlLink();
                    Page.Header.Controls.Add(link);

                    link.Href = Page.ClientScript.GetWebResourceUrl(
                        typeof(MenuBar),
                        string.Format("NCI.Web.UI.WebControls.Menus.Resources.MenuBar.{0}.css", MenuStyle.ToString()));

                    link.Attributes.Add("rel", "stylesheet");



                    //Mark that the stylesheet has been added so no other
                    //context menus will add this...
                    HttpContext.Current.Items.Add(MenuStyle, true);
                }
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/HippoError.aspx";
        head.Controls.AddAt(0, lk);

        HtmlMeta hm = new HtmlMeta();
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        string cookieName = FormsAuthentication.FormsCookieName;
        HttpCookie authCookie = Context.Request.Cookies[cookieName];

        FormsAuthenticationTicket authTicket = null;
        try
        {
            string group = "";
            if (authCookie != null)
            {
                authTicket = FormsAuthentication.Decrypt(authCookie.Value);
                group = authTicket.UserData.ToString();
            }

            if (group.Contains("User"))
            {
                Session["User"] = authTicket.Name;
                DataSet ds1 = dat.GetData("SELECT UserName FROM Users WHERE User_ID=" + authTicket.Name);
                Session["UserName"] = ds1.Tables[0].Rows[0]["UserName"].ToString();

                DataSet ds2 = dat.RetrieveAds(Session["User"].ToString(), false);
            }
            else
            {
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("~/login");
        }
    }
Esempio n. 26
0
        public static HtmlLink MakeCssIncludeControl([NotNull] string href)
        {
            CodeContracts.VerifyNotNull(href, "href");

            var stylesheet = new HtmlLink {
                Href = href
            };

            stylesheet.Attributes.Add("rel", "stylesheet");
            stylesheet.Attributes.Add("type", "text/css");

            return(stylesheet);
        }
Esempio n. 27
0
        private void LoadSkin(string template)
        {
            string skinPath = _SkinPath + template;
            string cssPath  = skinPath + "/css/style.css";

            HtmlLink cssLink = new HtmlLink();

            cssLink.Href = ResolveUrl(cssPath);
            cssLink.Attributes.Add("rel", "stylesheet");
            cssLink.Attributes.Add("type", "text/css");

            this.Page.Header.Controls.Add(cssLink);
        }
        protected void SetFavIcon()
        {
            string favIconPath = HttpContext.Current.Request.PhysicalApplicationPath + "favicon.ico";

            if (File.Exists(favIconPath))
            {
                string   favIconUrl = CommonHelper.GetStoreLocation() + "favicon.ico";
                HtmlLink htmlLink   = new HtmlLink();
                htmlLink.Attributes["rel"]  = "SHORTCUT ICON";
                htmlLink.Attributes["href"] = favIconUrl;
                Page.Header.Controls.Add(htmlLink);
            }
        }
Esempio n. 29
0
        /// <summary>
        /// Adds a CSS file to be linked from HEAD.
        /// </summary>
        public void AddCss(string cssName)
        {
            string href = "/style-{0}/{1}";

            href = string.Format(href, VerStr, cssName);
            HtmlLink link = new HtmlLink();

            link.Href = href;
            link.Attributes.Add("rel", "stylesheet");
            link.Attributes.Add("type", "text/css");
            link.Attributes.Add("media", "all");
            this.Page.Header.Controls.Add(link);
        }
        protected void ChangeBlueTheme(object sender, EventArgs e)
        {
            //Needed external storage for themes, will use on page_load this:
            MasterCSS.Href = "Styles/BlueTheme/MasterPage.min.css";
            //Just for demonstration on index page:
            HtmlLink css = new HtmlLink();

            css.Href = "/Styles/BlueTheme/Index.min.css";
            css.Attributes["rel"]   = "stylesheet";
            css.Attributes["type"]  = "text/css";
            css.Attributes["media"] = "all";
            Page.Header.Controls.Add(css);
        }
Esempio n. 31
0
        private void _AddStyleSheet(Type ObjectType, String URI)
        {
            String includeLocation = Page.ClientScript.GetWebResourceUrl(ObjectType, URI);

            HtmlLink HtmlLink = new HtmlLink();

            HtmlLink.Href = includeLocation;
            HtmlLink.Attributes.Add("rel", "stylesheet");
            HtmlLink.Attributes.Add("type", "text/css");

            // Add the HtmlLink to the Head section of the page.
            Page.Header.Controls.Add(HtmlLink);
        }
Esempio n. 32
0
        private void AddStylesheet()
        {
            string href = this.Page.Request.Url.GetLeftPart(UriPartial.Authority) + this.Page.ClientScript.GetWebResourceUrl(this.GetType(), resource);

            using (HtmlLink link = new HtmlLink())
            {
                link.Attributes.Add("rel", "stylesheet");
                link.Attributes.Add("type", "text/css");
                link.Href = href;

                this.Page.Header.Controls.Add(link);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "INDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HtmlLink lk = new HtmlLink();
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/MeaslesChart.aspx";
        head.Controls.AddAt(0, lk);
    }
Esempio n. 34
0
        protected void Page_Load(object sender, EventArgs e)
        {
            foreach (string styleSheet in StyleSheets)
            {
                HtmlLink newStyleSheet = new HtmlLink();
                newStyleSheet.Href = "../Stylesheets/" + styleSheet;
                newStyleSheet.Attributes.Add("type", "text/css");
                newStyleSheet.Attributes.Add("rel", "stylesheet");
                Page.Header.Controls.Add(newStyleSheet);
            }

            lblTodayDate.Text = DateTime.Today.ToShortDateString() + ", " + DateTime.Today.DayOfWeek;
        }
        /// <summary>
        /// Renders the rel link.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="id">The id.</param>
        /// <param name="rel">The rel.</param>
        /// <param name="href">The href.</param>
        private void RenderRelLink(HtmlTextWriter w, string id, string rel, string href)
        {
            if (string.IsNullOrEmpty(href))
            {
                return;
            }
            var htmlLink = new HtmlLink {
                ID = id, Href = href
            };

            htmlLink.Attributes["rel"] = rel;
            htmlLink.RenderControl(w);
        }
Esempio n. 36
0
        /// <summary>
        /// Creates and returns a generic link control.
        /// </summary>
        /// <param name="type">
        /// The HtmlLink's "type" attribute value.
        /// </param>
        /// <param name="relation">
        /// The HtmlLink's "rel" attribute value.
        /// </param>
        /// <param name="title">
        /// The HtmlLink's "title" attribute value.
        /// </param>
        /// <param name="href">
        /// The HtmlLink's "href" attribute value.
        /// </param>
        private static HtmlLink GetGenericLink(string type, string relation, string title, string href)
        {
            var link = new HtmlLink();

            if (type != null)
            {
                link.Attributes["type"] = type;
            }
            link.Attributes["rel"]   = relation;
            link.Attributes["title"] = title;
            link.Attributes["href"]  = href;
            return(link);
        }
Esempio n. 37
0
        protected override void OnInit(EventArgs e)
        {
            string   webResourceUrl = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "cn.justwin.Web.CSS.style.css");
            HtmlLink child          = new HtmlLink {
                Href = webResourceUrl
            };

            child.Attributes.Add("rel", "stylesheet");
            child.Attributes.Add("type", "text/css");
            this.Page.Header.Controls.Add(child);
            base.OnInit(e);
            this.Page.ClientScript.RegisterClientScriptResource(base.GetType(), "cn.justwin.Web.Js.SelectInput.js");
        }
Esempio n. 38
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            ScriptHelper.RegisterJsResource("Logictracker.Web.CustomWebControls.Labels.Popup.baloontip.js");
            var css = new HtmlLink();

            css.Href = ScriptHelper.GetWebResourceUrl("Logictracker.Web.CustomWebControls.Labels.Popup.baloontip.css");
            css.Attributes["rel"]   = "stylesheet";
            css.Attributes["type"]  = "text/css";
            css.Attributes["media"] = "all";

            Page.Header.Controls.Add(css);
        }
Esempio n. 39
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlLink link = new HtmlLink();

            link.Attributes.Add("rel", "stylesheet");
            link.Attributes.Add("type", "text/css");
            link.Attributes.Add("href", "Styles/Gadapta.css");
            this.Page.Header.Controls.Add(link);

            SilentMode            = (Request.QueryString["SilentMode"] != null && Request.QueryString["SilentMode"].ToString().ToUpper() == "TRUE");
            Session["SilentMode"] = SilentMode;
            LoadConfig(SilentMode);
        }
Esempio n. 40
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["RefUrl"] = Request.UrlReferrer.ToString();
        }
        //check previous page's URL for the id if Id hasn't been brought forward.
        if (Request.UrlReferrer.Query.Contains("?id"))
        {
            CategoryId = Request.UrlReferrer.Query.Substring(Request.UrlReferrer.Query.IndexOf("id") + 3);
        }
        else
        {
            CategoryId = Request["id"]; //check for id in URL
        }
        if (!string.IsNullOrEmpty(CategoryId))
        {
            Category category = null;
            if (!string.IsNullOrEmpty(CategoryId))
            {
                category = DocoManager.GetCategory(CategoryId);
            }

            if (!SecurityHelper.CanUserView(User.Identity.Name, category.Id))
            {
                // If the user cannot view the category, then return silently.
                object refUrl = ViewState["RefUrl"];
                if (refUrl != null)
                {
                    Response.Redirect((string)refUrl);
                }
            }

            lblDisplayName.InnerText = category.DisplayName;

            HtmlLink link = new HtmlLink();
            link.Href = Navigation.Doco_CategoryRss(CategoryId).GetServerUrl(true);
            link.Attributes.Add("rel", "alternate");
            link.Attributes.Add("type", "application/rss+xml");
            link.Attributes.Add("title", "Category " + category.DisplayName + " Announcements");
            Header.Controls.Add(link);
            //commenting this till the Creation row is finalised.
            string URL    = Navigation.Doco_NewArticle(CategoryId).GetAbsoluteClientUrl(true);
            bool   Access = SecurityHelper.CanUserEdit(Page.User.Identity.Name, category.Id);

            newLink = new Navigation.NavigateNewItem(URL, Access);

            pmm.LoadPermissionsView(category.Id, category.DisplayName);
            LoadList(category);
        }
    }
        /// <summary>
        /// Prepares to render the control.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!this.Visible)
            {
                return;
            }

            if (this.DownloadYahooUILibrary)
            {
                // Although we'll add the <script> tag to download the YAHOO component,
                // a download failure may have occurred, so protect ourselves from a
                // script error using an if (YAHOO) block.  But apparently at least in IE
                // that's not even enough, so we use a try/catch.
                string yuiLoadScript = @"try { if (YAHOO) {
	var loader = new YAHOO.util.YUILoader({
		require: ['button', 'menu'],
		loadOptional: false,
		combine: true
	});

	loader.insert();
} } catch (e) { }";
                this.Page.ClientScript.RegisterClientScriptInclude("yuiloader", this.Page.Request.Url.IsTransportSecure() ? YuiLoaderHttps : YuiLoaderHttp);
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "requiredYuiComponents", yuiLoadScript, true);
            }

            var css = new HtmlLink();

            try {
                css.Href = this.Page.ClientScript.GetWebResourceUrl(typeof(OpenIdAjaxTextBox), EmbeddedStylesheetResourceName);
                css.Attributes["rel"]  = "stylesheet";
                css.Attributes["type"] = "text/css";
                ErrorUtilities.VerifyHost(this.Page.Header != null, OpenIdStrings.HeadTagMustIncludeRunatServer);
                this.Page.Header.Controls.AddAt(0, css);                 // insert at top so host page can override
            } catch {
                css.Dispose();
                throw;
            }

            this.PrepareClientJavascript();

            // If an Identifier is preset on this control, preload discovery on that identifier,
            // but only if we're not already persisting an authentication result since that would
            // be redundant.
            if (this.Identifier != null && this.AuthenticationResponse == null)
            {
                this.PreloadDiscovery(this.Identifier);
            }
        }
Esempio n. 42
0
        private void createProductTags()
        {
            HtmlMeta tag = new HtmlMeta();

            tag.Attributes.Clear();
            tag.Attributes.Add("property", "fb:admins");
            tag.Attributes.Add("content", "");
            Header.Controls.Add(tag);

            tag = new HtmlMeta();
            tag.Attributes.Clear();
            tag.Attributes.Add("property", "og:title");
            tag.Attributes.Add("content", (ViewState["pageTitle"] != null ? ViewState["pageTitle"].ToString(): string.Empty) + " " + (ViewState["productDescription"] != null ? ViewState["productDescription"].ToString() : string.Empty));
            Header.Controls.Add(tag);

            tag = new HtmlMeta();
            tag.Attributes.Clear();
            tag.Attributes.Add("property", "og:type");
            tag.Attributes.Add("content", "product");
            Header.Controls.Add(tag);

            tag = new HtmlMeta();
            tag.Attributes.Clear();
            tag.Attributes.Add("property", "og:url");
            tag.Attributes.Add("content", "http://www.milupino.rs" + Page.Request.RawUrl);
            Header.Controls.Add(tag);

            tag = new HtmlMeta();
            tag.Attributes.Clear();
            tag.Attributes.Add("property", "og:image");
            tag.Attributes.Add("content", "http://www.milupino.rs" + ViewState["image"] != null ? ViewState["image"].ToString() : string.Empty);
            Header.Controls.Add(tag);

            tag = new HtmlMeta();
            tag.Attributes.Clear();
            tag.Attributes.Add("property", "og:site_name");
            tag.Attributes.Add("content", "Milupino | Vaša online prodavnica");
            Header.Controls.Add(tag);

            tag = new HtmlMeta();
            tag.Attributes.Clear();
            tag.Attributes.Add("property", "og:description");
            tag.Attributes.Add("content", string.Empty);
            Header.Controls.Add(tag);

            HtmlLink link = new HtmlLink();

            link.Attributes.Add("rel", "canonical");
            link.Attributes.Add("href", "http://www.milupino.rs" + Page.Request.RawUrl);
            Header.Controls.Add(link);
        }
Esempio n. 43
0
        /// <summary>预呈现。输出脚本</summary>
        /// <param name="e"></param>
        protected override void OnPreRender(EventArgs e)
        {
            //EnsureChildControls();

            base.OnPreRender(e);

            // 输出控制脚本
            Page.ClientScript.RegisterClientScriptResource(this.GetType(), "XControl.Button.choose.js");

            // 输出默认样式
            if (String.IsNullOrEmpty(BtnControl.CssClass) || BtnControl.CssClass == "choose")
            {
                try
                {
                    //Page.ClientScript.RegisterClientScriptResource(this.GetType(), "XControl.Button.choose.css");
                    HtmlLink link = new HtmlLink();
                    link.Href = Page.ClientScript.GetWebResourceUrl(this.GetType(), "XControl.Button.choose.css");
                    link.Attributes["rel"]  = "stylesheet";
                    link.Attributes["type"] = "text/css";
                    Page.Header.Controls.Add(link);

                    BtnControl.CssClass = "choose";
                }
                catch { }
            }

            BtnControl.Attributes.Add("val", HiddenControl.ClientID + "," + HiddenControlText.ClientID);

            String postbackJs = Page.ClientScript.GetPostBackEventReference(this, "");

            postbackJs = postbackJs.Replace("'", @"\'");
            string modalDialogOpts = !string.IsNullOrEmpty(ModalDialogOptions) ? "{" + ModalDialogOptions + "}" : "null";
            string extraClientOpts = !string.IsNullOrEmpty(ExtraClientOptions) ? "{" + ExtraClientOptions + "}" : (AutoPostBack ? "{after:'" + postbackJs + "'}" : "null");

            string otherClientClick = "return false;";

            //if (!String.IsNullOrEmpty(BtnControl.OnClientClick))
            //{
            //    otherClientClick = BtnControl.OnClientClick;
            //}

            // 由于Button控件将OnClientClick值保存到ViewState,所以在post之后,OnClientClick属性值会恢复
            // 所以这里不需要考虑保留旧值,并且ChooseButton控件没提供OnClientClick属性,外部也无法访问到Button控件的OnClientClick
            // 原有代码会在post一次之后反复叠加Choose()的js调用
            BtnControl.OnClientClick = string.Format("Choose(this,'{0}',{1},{2});{3}", ProcessedUrl, modalDialogOpts, extraClientOpts, otherClientClick);

            //if (String.IsNullOrEmpty(BtnControl.OnClientClick))
            //    BtnControl.OnClientClick = "Choose(this,'" + Url + "');return false;";
            //else
            //    BtnControl.OnClientClick = "Choose(this,'" + Url + "');" + BtnControl.OnClientClick;
        }
Esempio n. 44
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PropertyInfoX pix = PropertyInfoX.Create(Page.GetType(), "Navigation");
        if (pix != null) Navigation.Text = (String)pix.GetValue(Page);

        Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/Scripts/jquery-1.4.1.min.js"));
        Page.ClientScript.RegisterClientScriptInclude("adminstyle", ResolveUrl("~/Scripts/adminstyle.js"));

        HtmlLink link = new HtmlLink();
        link.Href = ResolveUrl("~/Admin/images/css.css");
        link.Attributes["rel"] = "stylesheet";
        link.Attributes["type"] = "text/css";
        Page.Header.Controls.Add(link);
    }
Esempio n. 45
0
        private void AddStylesheet()
        {
            var cssPath = Page
                          .ClientScript
                          .GetWebResourceUrl(typeof(DatabaseJobAdapter), "EPiServer.CodeSample.ScheduledJobAuditLog.JobAudit.css");
            var cssLink = new HtmlLink {
                Href = cssPath
            };

            cssLink.Attributes.Add("rel", "stylesheet");
            cssLink.Attributes.Add("type", "text/css");
            cssLink.Attributes.Add("media", "screen");
            Page.Header.Controls.Add(cssLink);
        }
Esempio n. 46
0
        private void AddStylesheet(string id, string path)
        {
            // First see if we have already added the <LINK> control
            if (this.Page.Header.FindControl(id) == null)
            {
                HtmlLink stylesheetLink = new HtmlLink();
                stylesheetLink.ID = id;
                stylesheetLink.Attributes["rel"]  = "stylesheet";
                stylesheetLink.Attributes["type"] = "text/css";
                stylesheetLink.Href = path;

                this.Page.Header.Controls.Add(stylesheetLink);
            }
        }
Esempio n. 47
0
 /// <summary>
 /// Register the CSS file to the header of this page, using key and file relative path.
 /// This function only works with serverside header of HTML page. Otherwise, it will do nothing.
 /// </summary>
 /// <param name="page">the page</param>
 /// <param name="key">the unique key identify the css file. If provides an existed key, nothing will be registered</param>
 /// <param name="rootRelativePath">relative path of the file</param>
 public static void RegisterCssFile(this Page page, string key, string rootRelativePath)
 {
     // if the style is not registered under key, we register it once
     if (page.Header != null && page.Header.FindControl(key) == null)
     {
         var link = new HtmlLink {
             ID = key
         };
         link.Attributes.Add("href", rootRelativePath);
         link.Attributes.Add("rel", "stylesheet");
         link.Attributes.Add("type", "text/css");
         page.Header.Controls.Add(link);
     }
 }
Esempio n. 48
0
    public void setPageAttr(Page mPage)
    {
        if ((int)mPage.Session["UserId"] == -1)
        {
            mPage.Response.Redirect("~/login.aspx?goBackTo=" + mPage.Server.UrlEncode(mPage.Request.RawUrl));
            return;
        }

        if (mPage.Session["profilePages"] == null)
        {
            fillProfilePagesArray(mPage);
        }

        string currPage = this.getSitePage(mPage.Request.RawUrl);

        string[,] tmpArray = (string[, ])mPage.Session["profilePages"];
        int accessFlag = 0;

        if (tmpArray == null)
        {
            mPage.Response.Redirect("~/site_messages.aspx?mess=npasftu");
        }
        else
        {
            for (int i = 0; i <= tmpArray.GetUpperBound(0); i++)
            {
                if (tmpArray[i, 0].ToString() == currPage)
                {
                    accessFlag = 1;
                    // set title of the current page
                    mPage.Title = tmpArray[i, 1].ToString();
                    // set master page for the current page
                    mPage.MasterPageFile = tmpArray[i, 2].ToString();
                    // set css file for the current page

                    HtmlLink myCSSLink = new HtmlLink();
                    myCSSLink.Href = tmpArray[i, 3].ToString();
                    myCSSLink.Attributes.Add("rel", "stylesheet");
                    myCSSLink.Attributes.Add("type", "text/css");
                    mPage.Master.FindControl("mpheader").Controls.Add(myCSSLink);
                    LiteralControl scryptLiteral = new LiteralControl("<script language=\"javascript\" type=\"text/javascript\" src=\"" + mPage.ResolveUrl("~/js_sources/main.js") + "\"></script>");
                    mPage.Master.FindControl("mpheader").Controls.Add(scryptLiteral);
                }
            }
            if (accessFlag == 0)
            {
                mPage.Response.Redirect("~/site_messages.aspx?mess=naftp");
            }
        }
    }
Esempio n. 49
0
        private void ShowCanonicalTag()
        {
            if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["p"]))
            {
                return;
            }

            // this means there is a pageing variable, so return the canonical tag
            var cLink = new HtmlLink();

            cLink.Attributes.Add("rel", "canonical");
            cLink.Href = CurrentPageAbsoluteUrl;
            Page.Header.Controls.Add(cLink);
        }
        private void AddStylesheet()
        {
            var cssPath = Page
                          .ClientScript
                          .GetWebResourceUrl(typeof(DatabaseJobAdapter), "Geta.ScheduledParameterJob.Style.JobParameters.css");
            var cssLink = new HtmlLink {
                Href = cssPath
            };

            cssLink.Attributes.Add("rel", "stylesheet");
            cssLink.Attributes.Add("type", "text/css");
            cssLink.Attributes.Add("media", "screen");
            Page.Header.Controls.Add(cssLink);
        }
 private void addStyleSheet(String href)
 {
     if (String.IsNullOrWhiteSpace(Convert.ToString(HttpContext.Current.Items[href])))
     {
         HttpContext.Current.Items[href] = href;
         HtmlLink sheet = new HtmlLink()
         {
             Href = href
         };
         sheet.Attributes["rel"]  = "stylesheet";
         sheet.Attributes["type"] = "text/css";
         this.Page.Header.Controls.Add(sheet);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlLink cssLink = new HtmlLink();

            cssLink.Href = "~/WebModules/MasterDetail/public/css/MasterDetail.css";
            cssLink.Attributes["rel"]  = "stylesheet";
            cssLink.Attributes["type"] = "text/css";
            Header.Controls.Add(cssLink);

            if (!IsPostBack)
            {
                BindData();
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/EventCommunicate.aspx";
        head.Controls.AddAt(0, lk);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        //Ajax.Utility.RegisterTypeForAjax(typeof(EventCommunicate));
        if (!IsPostBack)
        {
            string cookieName = FormsAuthentication.FormsCookieName;
            HttpCookie authCookie = Context.Request.Cookies[cookieName];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            FormsAuthenticationTicket authTicket = null;
            try
            {
                string group = "";
                if (authCookie != null)
                {
                    authTicket = FormsAuthentication.Decrypt(authCookie.Value);
                    group = authTicket.UserData.ToString();
                }

                if (group.Contains("User"))
                {
                    Session["User"] = authTicket.Name;

                    DoUser();

                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
Esempio n. 54
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink link = new HtmlLink();
        link.Href = Navigation.News_CategoryRss(null).GetServerUrl(true);
        link.Attributes.Add("rel", "alternate");
        link.Attributes.Add("type", "application/rss+xml");
        link.Attributes.Add("title", "News");
        Header.Controls.Add(link);

        if (!IsPostBack)
        {
            linkRss.HRef = Navigation.News_CategoryRss(null).GetServerUrl(true);

            LoadList();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/contact-us";
        head.Controls.AddAt(0, lk);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }

        DateTime isn = DateTime.Now;

        if (!DateTime.TryParse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"), out isn))
            isn = DateTime.Now;
        DateTime isNow = isn;
        Data dat = new Data(isn);
        SendItButton.SERVER_CLICK += SendIt;
        SendItButton2.SERVER_CLICK += SendItNotLoggedIn;

        try
        {
            Session["RedirectTo"] = Request.Url.AbsoluteUri;

            if (Session["User"] != null)
            {
                LoggedInPanel.Visible = true;
                LogInPanel.Visible = false;
            }
            else
            {
                LoggedInPanel.Visible = false;
                LogInPanel.Visible = true;
            }
        }
        catch (Exception ex)
        {
            LoggedInPanel.Visible = false;
            LogInPanel.Visible = true;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }

        DateTime isn = DateTime.Now;

        if (!DateTime.TryParse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"), out isn))
            isn = DateTime.Now;
        DateTime isNow = isn;
        Data dat = new Data(isn);
        try
        {
            HtmlHead head = (HtmlHead)Page.Header;
            HtmlLink lk = new HtmlLink();
            lk.Href = "http://" + Request.Url.Authority + "/enter-trip";
            lk.Attributes.Add("rel", "bookmark");
            head.Controls.AddAt(0, lk);

            EventTitle.Text = "<a  style=\"text-decoration: none;\"  href=\"http://" + Request.Url.Authority + "/enter-trip\" ><h1>Entering an Adventure</h1></a>";

            Session["RedirectTo"] = "enter-trip";
            if (Session["User"] != null)
            {
                WelcomeLabel.Text = "On Hippo Happenings, the users have all the power to post events, local trips, bulletins and locales alike. " +
                    "Having an account with us also allows you to do many other things. You're able to add events to your calendar, communicate with others going to events, add your friends, filter content based on your preferences, " +
                    " feature your bulletins thoughout the site and much more. <br/><br/>So let's go <a class=\"NavyLink12\" style=\"font-size: 16px;\" href=\"enter-trip\">Post a Trip!</a>";
            }
            else
            {
                WelcomeLabel.Text = "<h1 class=\"SideColumn\">You Need To Be <a class=\"NavyLink12\" href=\"login\">Logged In</a> to Post A Trip.</h1><br/>On Hippo Happenings, the users have all the power to post events, local trips, bulletins and locales alike. In order to do so, and for us to maintain clean and manageable content,  "
                    + " we require that you <a class=\"NavyLink12\" href=\"Register.aspx\">create an account</a> with us. <a class=\"NavyLink12\" href=\"login\">Log in</a> if you have an account already. " +
                    "Having an account with us will allow you to do many other things as well. You'll will be able to add events to your calendar, communicate with others going to events, add your friends, filter content based on your preferences, " +
                    " feature your bulletins thoughout the site and much more. <br/><br/>So let's go <a class=\"NavyLink12\" style=\"font-size: 16px;\" href=\"Register.aspx\">Register!</a>";
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("~/login");
        }
    }
Esempio n. 57
0
    public static void AddIcon(System.Web.UI.Page page, string imagePath)
    {
        if (page.Header == null)
        {
            return;
        }

        if (page.Header.ClientID == "None")
        {
            return;
        }

        HtmlLink link = new HtmlLink();
        link.Href = imagePath;
        link.Attributes["rel"] = "shortcut icon";
        page.Header.Controls.Add(link);
    }
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        ITextControl failure = (ITextControl)ChangePassword1.ChangePasswordTemplateContainer.FindControl("FailureText");
        if (failure != null && !string.IsNullOrEmpty(failure.Text) && passwordChangeError)
        {
            this.messageCtrl.Message = failure.Text;
            this.messageCtrl.Mode = Telerik.Cms.Web.UI.MessageMode.Error;
        }

        HtmlLink css = new HtmlLink();
        css.Href = ResolveUrl(String.Concat("~/Sitefinity/Admin/Themes/Default/myprofile.css"));
        css.Attributes.Add("rel", "stylesheet");
        css.Attributes.Add("type", "text/css");
        this.Header.Controls.Add(css);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlLink lk = new HtmlLink();
        HtmlHead head = (HtmlHead)Page.Header;
        lk.Attributes.Add("rel", "canonical");
        lk.Href = "http://hippohappenings.com/PasswordAlert.aspx";
        head.Controls.AddAt(0, lk);

        HtmlMeta hm = new HtmlMeta();
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        Encryption decrypt = new Encryption();
        if (Request.QueryString["message"] != null)
            MessageLabel.Text = decrypt.decrypt(Request.QueryString["message"].ToString());
    }
Esempio n. 60
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FieldInfoX fix = FieldInfoX.Create(Page.GetType(), "Manager");
        if (fix != null)
        {
            IManagePage manager = fix.GetValue(Page) as IManagePage;
            if (manager != null) Navigation.Text = manager.Navigation;
        }

        Page.ClientScript.RegisterClientScriptInclude("jquery", ResolveUrl("~/Scripts/jquery-1.4.1.min.js"));
        Page.ClientScript.RegisterClientScriptInclude("adminstyle", ResolveUrl("~/Scripts/adminstyle.js"));

        HtmlLink link = new HtmlLink();
        link.Href = ResolveUrl("~/Admin/images/css.css");
        link.Attributes["rel"] = "stylesheet";
        link.Attributes["type"] = "text/css";
        Page.Header.Controls.Add(link);
    }