当前位置: 首页>>代码示例>>C#>>正文


C# Data.stripHTML方法代码示例

本文整理汇总了C#中Data.stripHTML方法的典型用法代码示例。如果您正苦于以下问题:C# Data.stripHTML方法的具体用法?C# Data.stripHTML怎么用?C# Data.stripHTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Data的用法示例。


在下文中一共展示了Data.stripHTML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddAgendaItem

 protected void AddAgendaItem(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", ":")));
     AgendaItemTextBox.Text = dat.stripHTML(AgendaItemTextBox.Text.Trim());
     AgendaDescriptionTextBox.Text = dat.stripHTML(AgendaDescriptionTextBox.Text.Trim());
     if (AgendaItemTextBox.Text.Trim() != "")
     {
         AgendaLiteral.Text += "<div style=\"padding: 0px; padding-bottom: 3px;\" class=\"AddLink\">" +
             dat.BreakUpString(AgendaItemTextBox.Text.Trim(), 44) + "</div>";
         if (AgendaDescriptionTextBox.Text.Trim() != "")
         {
             AgendaLiteral.Text += "<div style=\"padding: 0px; padding-left: 20px; padding-bottom: 3px; color: #cccccc; font-family: arial; font-size: 11px;\">" +
             dat.BreakUpString(AgendaDescriptionTextBox.Text.Trim(), 44) + "</div>";
         }
     }
     else
     {
         AgendaErrorLabel.Text = "Must include the item title.";
     }
 }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:28,代码来源:EnterGroupEvent.aspx.cs

示例2: DrawEvents

    protected void DrawEvents(DataView dvEvents, int cutOff)
    {
        string eventID = GetEventID();
        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 isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        Literal lit = new Literal();

        int count = 0;
        DataView dvEvent;
        string contentSub = "";
        foreach (DataRowView row in dvEvents)
        {
            if (count > cutOff - 1)
            {
                break;
            }
            else
            {
                contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
                    "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                    "").Replace("<br />", "").Replace("<BR />", ""));
                if (dat.stripHTML(row["Content"].ToString().Replace("<br>",
                    "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                    "").Replace("<br />", "").Replace("<BR />", "")).Length > 100)
                    contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
                        "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                        "").Replace("<br />", "").Replace("<BR />", "")).Substring(0, 100);
                dvEvent = dat.GetDataDV("SELECT * FROM Events E, Event_Occurance EO WHERE E.ID=EO.EventID AND E.ID=" + row["EventID"].ToString());
                lit.Text += "<div class=\"SimilarSide\">";
                lit.Text += "<a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                    "_" + row["EventID"].ToString() + "_Event\">" + row["Header"].ToString() +
                    "</a> at " + "<a class=\"Green12LinkNF\" href=\"" + dat.MakeNiceName(row["Name"].ToString()) +
                    "_" + row["Venue"].ToString() + "_Venue\">" + row["Name"].ToString() + "</a> on " +
                    DateTime.Parse(dvEvent[0]["DateTimeStart"].ToString()).ToShortDateString() +
                    ". " + dat.BreakUpString(contentSub, 30) +
                    "... <a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                    "_" + row["EventID"].ToString() + "_Event\">Read More</a>";
                lit.Text += "</div>";
                count++;
            }
        }

        OtherEventsPanel.Controls.Add(lit);
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:53,代码来源:Event.aspx.cs

示例3: DrawBulletins

    protected void DrawBulletins(DataView dvEvents, int cutOff)
    {
        string eventID = Request.QueryString["AdID"];
        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 isNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        Literal lit = new Literal();

        int count = 0;
        DataView dvEvent;
        string contentSub = "";
        foreach (DataRowView row in dvEvents)
        {
            if (count > cutOff - 1)
            {
                break;
            }
            else
            {
                contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
                    "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                    "").Replace("<br />", "").Replace("<BR />", ""));
                if (dat.stripHTML(row["Content"].ToString().Replace("<br>",
                    "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                    "").Replace("<br />", "").Replace("<BR />", "")).Length > 100)
                    contentSub = dat.stripHTML(row["Content"].ToString().Replace("<br>",
                        "").Replace("</br>", "").Replace("<br/>", "").Replace("<BR>", "").Replace("<BR/>",
                        "").Replace("<br />", "").Replace("<BR />", "")).Substring(0, 100);

                lit.Text += "<div class=\"SimilarSide\">";
                lit.Text += "<a class=\"Green12LinkNF\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                    "_" + row["AdID"].ToString() + "_Ad\">" + row["Header"].ToString() +
                    "</a>. " + dat.BreakUpString(contentSub, 30) +
                    "... <a class=\"Blue12Link\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                    "_" + row["AdID"].ToString() + "_Ad\">Read More</a>";
                lit.Text += "</div>";
                count++;
            }
        }

        OtherAdsPanel.Controls.Add(lit);
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:50,代码来源:Ad.aspx.cs

示例4: SendIt

    protected void SendIt(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);
        }
        if (EmailTextBox.Text != "")
        {
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            SqlDbType [] types = {SqlDbType.NVarChar};
            EmailTextBox.Text = dat.stripHTML(EmailTextBox.Text.Trim());
            object[] parameters = { EmailTextBox.Text };
            DataSet ds = dat.GetDataWithParemeters("SELECT * FROM Users WHERE [email protected]", types, parameters);

            bool isNot = false;
            if (ds.Tables.Count > 0)
                if (ds.Tables[0].Rows.Count > 0)
                {
                    Encryption encrypt = new Encryption();
                    Random r = new Random(0);
                    string code = encrypt.encrypt(ds.Tables[0].Rows[0]["UserName"].ToString() + r.Next().ToString());
                    dat.Execute("UPDATE Users SET PasswordReset='" + code + "' WHERE User_ID="+ds.Tables[0].Rows[0]["User_ID"].ToString());
                    string body = "You have requested to re-set your password with Hippo Happenings. <br/>" +
                        "Please visit <a href=\"http://HippoHappenings.com/ResetPassword.aspx?CODE=" + code + "&UserName=" +
                        ds.Tables[0].Rows[0]["UserName"].ToString() + "\">http://HippoHappenings.com/ResetPassword.aspx?CODE=" + code + "&UserName=" +
                        ds.Tables[0].Rows[0]["UserName"].ToString() + "</a> to do so.";
                    dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString(),
                System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
                        ds.Tables[0].Rows[0]["Email"].ToString(), body, "Hippo Happenings Reset Password Request");
                    MessageLabel.Text = "An email with the instructions has been sent to your account.";
                }
                else
                    isNot = true;
            else
                isNot = true;

            if (isNot)
            {
                MessageLabel.Text = "There is no user associated with this email address. Please make sure you have typed it correctly.";
            }
        }
        else
        {
            MessageLabel.Text = "Please include the Email";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:50,代码来源:PasswordAlert.aspx.cs

示例5: AddSearchTerm

    protected void AddSearchTerm(object sender, EventArgs e)
    {
        TermsErrorLabel.Text = "";
        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);

        TermsBox.Text = dat.stripHTML(TermsBox.Text);
        string troubleTerms = "";
        if (TermsBox.Text.Trim() != "")
        {
            if (!TermsBox.Text.Contains(" "))
            {
                if (!SearchTermsListBox.Items.Contains(new ListItem(TermsBox.Text.Trim())))
                {
                    if (!CheckFor4Bulletins(true, TermsBox.Text.Trim(), ref troubleTerms))
                    {
                        SearchTermsListBox.Items.Add(new ListItem(TermsBox.Text.Trim()));
                        FillChart(new object(), new EventArgs());
                    }
                    else
                    {
                        TermsErrorLabel.Text = "There are already too many featured bulletins " +
                            "with the search term and date combination you are trying to add. " +
                            "The combination in question is: " + troubleTerms;
                    }
                }
                else
                {
                    TermsErrorLabel.Text = "You can only add the same search term once.";
                }
            }
            else
            {
                TermsErrorLabel.Text = "Search terms cannot contain spaces.";
            }
        }
        else
        {
            TermsErrorLabel.Text = "Please include a search term.";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:54,代码来源:PostAnAd.aspx.cs

示例6: Suggest

    protected void Suggest(object sender, EventArgs e)
    {
        if (VenueSuggestTextBox.Text.Trim() != "")
        {
            Data dat = new Data(DateTime.Now);
            VenueSuggestTextBox.Text = dat.stripHTML(VenueSuggestTextBox.Text.Trim());

            dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString(),
                System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
                System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString()
                , "Gotten a venue suggestions from: IP: " + dat.GetIP() + ", Message: " + VenueSuggestTextBox.Text + ", Email: " + EmailTextBox.Text,
                "Venue Suggestion Submitted");

            SuggestErrorLabel.Text = "Your suggestion has been made! Thanks!";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:16,代码来源:Home.aspx.cs

示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];

        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);

        string background = "";
        if (isFeatured)
        {
            background = "background-color: #e9f1f4;";
        }
        else
        {
            background = "border-bottom: solid 1px #dedbdb;";
        }

        if (searchNumber != "")
        {
            string markerNumber = dat.GetImageNum(searchNumber);
            ImageLiteral.Text = imageLiteral + "<div style=\"float: left;padding-right: 5px;height: 50px;\"><img style=\"cursor: pointer;\" onclick=\"myclick(" + markerNumber + ");\" src=" +
                "\"http://www.google.com/mapfiles/marker" + searchNumber + ".png\" /></div>";
            BeginingLiteral.Text = "<div style=\"clear: both;margin-top: 3px;height: 56px;margin-bottom: 3px; width: " + width.ToString() +
                "px; padding: 3px;" + background + "\">";
        }
        else
        {
            BeginingLiteral.Text = "<div class=\"topDiv\" style=\"clear: both;background-color:" + color + "; width: " + width.ToString() +
                "px; padding: 3px; margin-bottom: 3px;" + background + "\">";
        }

        SearchLabel.NavigateUrl = "../" + dat.MakeNiceName(searchLabel) + "_" + venueID + "_Venue";

        if (searchLabel.Length > 36)
        {
            searchLabel = searchLabel.Substring(0, 33) + "...";
        }

        SearchLabel.Text = dat.stripHTML(searchLabel);

        DataView dvEvent = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + venueID);

        string shortDesc = "";

        if (dvEvent[0]["Content"].ToString().Trim() != "")
        {
            shortDesc = dat.stripHTML(dvEvent[0]["Content"].ToString()).Trim();
            if (shortDesc.Length > 113)
            {
                shortDesc = shortDesc.Substring(0, 110) + "...";
            }
        }

        ShortDescriptionLabel.Text = dat.stripHTML(shortDesc);

        DataView dvEventsSlider = dat.GetDataDV("SELECT * FROM Venues E, Venue_Slider_Mapping ESM "+
            "WHERE E.ID=ESM.VenueID AND E.ID=" + venueID);
        if (dvEventsSlider.Count > 0)
        {
            if (System.IO.File.Exists(MapPath("../") + "\\VenueFiles\\" +
                venueID + "\\Slider\\" + dvEventsSlider[0]["PictureName"].ToString()))
            {
                System.Drawing.Image img = System.Drawing.Image.FromFile(MapPath("../") + "\\VenueFiles\\" +
                    venueID + "\\Slider\\" + dvEventsSlider[0]["PictureName"].ToString());

                SaveThumbnail(img, MapPath("../") + "\\Temp\\Temp_" + dvEventsSlider[0]["PictureName"].ToString());
                EventImageLiteral.Text = "<img style='float: left; padding-right: 5px;' src='http://hippohappenings.com/Temp/Temp_" +
                    dvEventsSlider[0]["PictureName"].ToString() + "' />";
            }
        }
        else
        {
            EventImageLiteral.Text = "";
        }

        string begining = "<div class=\"TextNormal\">";
        string end = "</div>";
        TagsLiteral.Text = begining + end;

        dat.TAG_TYPE = Data.tagType.VENUE;

        int tagLength = 0;

        if (ShortDescriptionLabel.Text.Length > 64)
        {
            tagLength = 57;
        }
        else if (ShortDescriptionLabel.Text.Length == 0)
        {
            tagLength = 183;
        }
        else
        {
            tagLength = 122;
        }

//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:VenueSearchElement.ascx.cs

示例8: SendIt

    protected void SendIt(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        SubjectTextBox.Text = dat.stripHTML(SubjectTextBox.Text);
        MessageTextBox.Text = dat.stripHTML(MessageTextBox.Text);
        if (SubjectTextBox.Text != "" && MessageTextBox.Text != "")
        {
            try
            {

                string command = "INSERT INTO MessagesForAdmin (UserID, Message, Subject, Type) VALUES(@p0, @p1, @p2, @p3)";
                SqlDbType[] types = { SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int };
                object[] data = { int.Parse(Session["User"].ToString()), MessageTextBox.Text, SubjectTextBox.Text, 1 };
                dat.ExecuteWithParemeters(command, types, data);

                DataSet dsUser = dat.GetData("SELECT * FROM Users WHERE User_ID="+Session["User"].ToString());

                dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString(),
                    System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
                    System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString()
                    , "User ID: " + Session["User"].ToString() + ", UserName: " +
                    dsUser.Tables[0].Rows[0]["UserName"].ToString() +
                    " has filled out a 'Contact Us' form. Here is their message: <br/><br/>" +
                    MessageTextBox.Text, "Contact Us Form Submitted: "+SubjectTextBox.Text);

                dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString(),
                    System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(),
                    dsUser.Tables[0].Rows[0]["Email"].ToString()
                    , "<br/><br/>Your contact request has been submitted to Hippo Happenings. We will reply to your "+
                    "request momentarily.", "Hippo Happenings Contact Request Submitted");

                Encryption encrypt = new Encryption();
                MessageRadWindow.NavigateUrl = "Message.aspx?message=" + encrypt.encrypt("<br/>Your message has been sent. We will get back to you as soon as possible.<br/><br/><button onclick=\"Search('Home.aspx');\" name=\"Ok\" title=\"Ok\">Ok</button>");
                MessageRadWindow.Visible = true;
                MessageRadWindowManager.VisibleOnPageLoad = true;

            }
            catch (Exception ex)
            {

            }
        }
        else
        {
            if (SubjectTextBox.Text == "")
                SubjectRequired.Text = "*Please include the subject";
            if (MessageTextBox.Text == "")
                MessageRequired.Text = "*Please include a message";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:51,代码来源:ContactUs.aspx.cs

示例9: PostEvents


//.........这里部分代码省略.........
                                + imagePath + "\" /></a></td></tr></table><div style=\"font-weight: bold;color: white;position: absolute;bottom: 0;width: 240px; height: 50px; z-index: 1000;\"><table cellpadding='0' cellspacing='0' height='50px'><tr><td valign='center'><div align='center'>" +
                                row["Header"].ToString() + "</div></td></tr></table></div>" +
                                "<div style=\"vertical-align: middle;color: white;position: absolute; bottom: 0;width: 240px; " +
                                "background-color: black; opacity: .7; filter: alpha(opacity=70);height: 50px;\"></div>" +
                                "</div>";
                            lit.Text = imageStr;
                        }
                        else
                        {

                            DataView dvTime = dat.GetDataDV("SELECT * FROM Event_Occurance WHERE EventID=" +
                                row["EventID"].ToString() + " ORDER BY DateTimeStart DESC");
                            DateTime itEvent = new DateTime();
                            itEvent = DateTime.Parse(dvTime[0]["DateTimeStart"].ToString());
                            string timeStr = GetTimeStr(itEvent);

                            lit.Text = "<div class=\"Home42\"><div class=\"Home43\"><div align=\"center\" class=\"FooterBottom\">" +
                                "<h2 class=\"Event\"><a class=\"HomeEventTitle\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                                "_" + row["EventID"].ToString() + "_Event\">";

                            string headerStr = row["Header"].ToString();

                            if (headerStr.Length > 49)
                            {
                                headerStr = headerStr.Substring(0, 46) + "...";
                            }

                            lit.Text += dat.BreakUpString(headerStr, 20) + "</a></h2></div><div class=\"FooterBottom\">" +
                                imageStr + "<div class=\"Text12 Home44\">";

                            int contentLimit = 105;
                            if (imageStr == "")
                                contentLimit = 281;
                            content = dat.stripHTML(row["Content"].ToString());
                            if (content.Length > contentLimit)
                            {
                                content = content.Substring(0, contentLimit) + "...";
                            }

                            lit.Text += timeStr + "<br/>" +
                                dat.BreakUpString(content.Replace("<br/>", " ").Replace("<br>",
                                " ").Replace("<br />", " ").Replace("<BR>", " ").Replace("<BR />",
                                " ").Replace("<BR/>", " "), 13);

                            lit.Text += "</div><div class=\"ReadMoreHome\"><a class=\"ReadMoreHome\" href=\"" + dat.MakeNiceName(row["Header"].ToString()) +
                                "_" + row["EventID"].ToString() + "_Event\">Read More</a></div></div></div></div>";
                        }

                        item.Controls.Add(lit);
                        RadRotator1.Items.Add(item);
                    }
                    else if (row["Type"].ToString() == "T")
                    {
                        DataView dsSlider = dat.GetDataDV("SELECT * FROM Trip_Slider_Mapping WHERE TripID=" +
                            row["EventID"].ToString());

                        string imageStr = "";
                        bool isImage = false;
                        if (dsSlider.Count > 0)
                        {
                            isImage = true;
                            if (!System.IO.File.Exists(MapPath(".") + "/Trips/" + row["EventID"].ToString() + "/Slider/" + dsSlider[0]["PictureName"].ToString()))
                            {
                                isImage = false;
                            }
                        }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:67,代码来源:Home.aspx.cs

示例10: Search


//.........这里部分代码省略.........
            Panel StateDropDownPanel = (Panel)locationSearchPanel.Items[0].Items[0].FindControl("StateDropDownPanel");
            //Label ResultsLabel = (Label)SearchPanel.Items[1].Items[0].FindControl("ResultsLabel");
            //SearchElements SearchElements2 = (SearchElements)SearchPanel.Items[1].Items[0].FindControl("SearchElements2");
            //ASP.controls_hippotextbox_ascx SearchTextBox = (ASP.controls_hippotextbox_ascx)SearchPanel.Items[0].Items[0].FindControl("SearchTextBox");
            //Telerik.Web.UI.RadComboBox DateDropDown = (Telerik.Web.UI.RadComboBox)SearchPanel.Items[0].Items[0].FindControl("DateDropDown");
            //Telerik.Web.UI.RadComboBox CountryDropDown = (Telerik.Web.UI.RadComboBox)SearchPanel.Items[0].Items[0].FindControl("CountryDropDown");
            Telerik.Web.UI.RadComboBox StateDropDown = (Telerik.Web.UI.RadComboBox)locationSearchPanel.Items[0].Items[0].FindControl("StateDropDown");
            //Telerik.Web.UI.RadComboBox VenueDropDown = (Telerik.Web.UI.RadComboBox)SearchPanel.Items[0].Items[0].FindControl("VenueDropDown");
            Telerik.Web.UI.RadTextBox StateTextBox = (Telerik.Web.UI.RadTextBox)locationSearchPanel.Items[0].Items[0].FindControl("StateTextBox");
            Telerik.Web.UI.RadTextBox CityTextBox = (Telerik.Web.UI.RadTextBox)locationSearchPanel.Items[0].Items[0].FindControl("CityTextBox");
            //Telerik.Web.UI.RadComboBox RatingDropDown = (Telerik.Web.UI.RadComboBox)SearchPanel.Items[0].Items[0].FindControl("RatingDropDown");
            //Telerik.Web.UI.RadTreeView CategoryTree = (Telerik.Web.UI.RadTreeView)SearchPanel.Items[0].Items[0].FindControl("CategoryTree");
            //Telerik.Web.UI.RadTreeView RadTreeView1 = (Telerik.Web.UI.RadTreeView)SearchPanel.Items[0].Items[0].FindControl("RadTreeView1");
            DropDownList RadiusDropDown = (DropDownList)locationSearchPanel.Items[1].Items[0].FindControl("RadiusDropDown");
            //Label MessageLabel = (Label)SearchPanel.Items[0].Items[0].FindControl("MessageLabel");
            //MessageLabel.Text = "";
            //Button SearchButton = (Button)SearchPanel.Items[0].Items[0].FindControl("SearchButton");
            TextBox ZipTextBox = (TextBox)locationSearchPanel.Items[1].Items[0].FindControl("ZipTextBox");

            Panel RadiusTitlePanel = (Panel)locationSearchPanel.Items[1].Items[0].FindControl("RadiusTitlePanel");
            Panel RadiusDropPanel = (Panel)locationSearchPanel.Items[1].Items[0].FindControl("RadiusDropPanel");
            Panel USLabelPanel = (Panel)locationSearchPanel.Items[1].Items[0].FindControl("USLabelPanel");

            //HtmlGenericControl TimeFrameDiv = (HtmlGenericControl)SearchPanel.Items[0].Items[0].FindControl("TimeFrameDiv");

            string resultsStr = "";

            try
            {
                //SearchElements2.Clear();

                Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

                SearchTextBox.THE_TEXT = dat.stripHTML(SearchTextBox.THE_TEXT);

                char[] delim = { ' ' };
                string[] tokens;

                tokens = SearchTextBox.THE_TEXT.Split(delim);
                string temp = "";
                if (SearchTextBox.THE_TEXT.Trim() != "")
                {
                    for (int i = 0; i < tokens.Length; i++)
                    {
                        temp += " E.Header LIKE @search" + i.ToString();

                        if (i + 1 != tokens.Length)
                            temp += " AND ";
                    }
                    resultsStr += "'" + SearchTextBox.THE_TEXT + "' ";
                }
                if (temp != "")
                    temp = " AND " + temp;

                bool isZip = false;

                if (locationSearchPanel.Items[1].Expanded && ZipTextBox.Text.Trim() != "")
                {
                    isZip = true;
                }
                else
                {
                    if (CityTextBox.Text.Trim() == "")
                        isZip = true;
                }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:66,代码来源:EventSearch_OLD.aspx.cs

示例11: OnwardsIT

    protected bool OnwardsIT(bool changeTab, int selectedIndex)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];

            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
            conn.Open();
            string message = "";
            bool goOn = false;
            switch (selectedIndex)
            {
                case 0:
                    #region Case 0

                    bool hasLocation = false;
                    if (DateSelectionsListBox.Items.Count > 0)
                        hasLocation = true;

                    DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>",
                        "<br/>").Replace("</div>", ""));

                    if (hasLocation)
                    {
                        VenueNameTextBox.THE_TEXT = dat.stripHTML(VenueNameTextBox.THE_TEXT);
                        DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>",
                            "<br/>").Replace("</div>", ""));

                        if (VenueNameTextBox.THE_TEXT.Trim() != "" && DescriptionTextBox.Text.Trim() != "")
                        {
                            if (DescriptionTextBox.Text.Length <= 420)
                            {
                                if (VenueNameTextBox.THE_TEXT.Trim().Length <= 70)
                                {
                                    if (changeTab)
                                        ChangeSelectedTab(0, 1);

                                    return true;
                                }
                                else
                                {
                                    MessagePanel.Visible = true;
                                    YourMessagesLabel.Text += "<br/><br/>*Group Event Name be under 70 characters.";
                                }
                            }
                            else
                            {
                                MessagePanel.Visible = true;
                                YourMessagesLabel.Text += "<br/><br/>*Description must be under 420 characters.";
                            }

                        }
                        else
                        {
                            MessagePanel.Visible = true;
                            YourMessagesLabel.Text += "<br/><br/>*Please fill in all required fields.";
                        }
                    }
                    else
                    {
                        MessagePanel.Visible = true;
                        YourMessagesLabel.Text += "<br/><br/>*Please specify date and location.";

                    }
                    return false;
                    #endregion
                    break;
                case 1:
                    if (changeTab)
                    {
                        ChangeSelectedTab(1, 2);
                    }
                    return true;
                    break;
                case 2:
                    if (changeTab)
                    {
                        ChangeSelectedTab(2, 3);

                    }
                    return true;
                    break;
                case 3:
                    goOn = false;
                    if (ParticipantsList.SelectedIndex != -1)
                    {
                        if (ParticipantsList.SelectedValue == "3" && GroupMembersSelectedListBox.Items.Count == 0)
                            message = "Please select the members for your Exclusive Event type.";
                        else
                        {
                            if (RagistrationRadioList.SelectedIndex != -1)
                            {
                                if (RagistrationRadioList.SelectedValue == "2" && NumRegTextBox.Text.Trim() == ""
                                    && DeadlineDatePicker.SelectedDate == null)
                                {
                                    message = "Please select either the limit of users or deadline for the Limited Registration Type.";
                                }
                                else
                                    goOn = true;
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:EnterGroupEvent.aspx.cs

示例12: DoSearch

    protected void DoSearch()
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        //ASP.controls_adsearchelements_ascx SearchElements2 = (ASP.controls_adsearchelements_ascx)SearchPanel.Items[1].Items[0].FindControl("SearchElements2");
        //Label MessageLabel = (Label)SearchPanel.Items[0].Items[0].FindControl("MessageLabel");
        try
        {
            //SearchElements2.Clear();
            //Telerik.Web.UI.RadPanelBar locationSearchPanel = (Telerik.Web.UI.RadPanelBar)SearchPanel.Items[0].Items[0].FindControl("locationSearchPanel");

            Telerik.Web.UI.RadTextBox StateTextBox = (Telerik.Web.UI.RadTextBox)locationSearchPanel.Items[0].Items[0].FindControl("StateTextBox");
            //Telerik.Web.UI.RadComboBox CountryDropDown = (Telerik.Web.UI.RadComboBox)SearchPanel.Items[0].Items[0].FindControl("CountryDropDown");
            Telerik.Web.UI.RadComboBox StateDropDown = (Telerik.Web.UI.RadComboBox)locationSearchPanel.Items[0].Items[0].FindControl("StateDropDown");
            Telerik.Web.UI.RadTextBox CityTextBox = (Telerik.Web.UI.RadTextBox)locationSearchPanel.Items[0].Items[0].FindControl("CityTextBox");
            //ASP.controls_hippotextbox_ascx SearchTextBox = (ASP.controls_hippotextbox_ascx)SearchPanel.Items[0].Items[0].FindControl("SearchTextBox");
            Panel StateDropDownPanel = (Panel)locationSearchPanel.Items[0].Items[0].FindControl("StateDropDownPanel");
            Panel StateTextBoxPanel = (Panel)locationSearchPanel.Items[0].Items[0].FindControl("StateTextBoxPanel");
            //Telerik.Web.UI.RadTreeView CategoryTree = (Telerik.Web.UI.RadTreeView)SearchPanel.Items[0].Items[0].FindControl("CategoryTree");
            //Telerik.Web.UI.RadTreeView RadTreeView1 = (Telerik.Web.UI.RadTreeView)SearchPanel.Items[0].Items[0].FindControl("RadTreeView1");

            TextBox ZipTextBox = (TextBox)locationSearchPanel.Items[1].Items[0].FindControl("ZipTextBox");
            DropDownList RadiusDropDown = (DropDownList)locationSearchPanel.Items[1].Items[0].FindControl("RadiusDropDown");
            Panel RadiusTitlePanel = (Panel)locationSearchPanel.Items[1].Items[0].FindControl("RadiusTitlePanel");
            Panel RadiusDropPanel = (Panel)locationSearchPanel.Items[1].Items[0].FindControl("RadiusDropPanel");
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            char[] delim = { ' ' };
            string[] tokens;

            SearchTextBox.THE_TEXT = dat.stripHTML(SearchTextBox.THE_TEXT);

            string resultsStr = "";

            tokens = SearchTextBox.THE_TEXT.Split(delim);
            string temp = "";
            if (SearchTextBox.THE_TEXT.Trim() != "")
            {
                for (int i = 0; i < tokens.Length; i++)
                {
                    temp += " (A.Content LIKE @search" + i.ToString() +
                        " OR A.Header LIKE @search" + i.ToString() + ") ";

                    if (i + 1 != tokens.Length)
                        temp += " OR ";
                }
                resultsStr += "'" + SearchTextBox.THE_TEXT + "' ";
            }
            if (temp != "")
                temp = " AND " + temp;
            string country = " AND A.Country=" + CountryDropDown.SelectedValue;

            string city = "";
            string cityParam = "";
            string zip = "";
            string zipParameter = "";
            string state = "";
            string stateParam = "";
            int zipParam = 0;

            bool goOn = true;
            string message = "";
            bool isZip = false;

            if (locationSearchPanel.Items[1].Expanded && ZipTextBox.Text.Trim() != "")
            {
                isZip = true;
            }
            else
            {
                if (CityTextBox.Text.Trim() == "" && ZipTextBox.Text.Trim() != "")
                    isZip = true;
            }

            if (isZip)
            {
                if (ZipTextBox.Text.Trim() != "")
                {
                    resultsStr += "in " + ZipTextBox.Text.Trim() + " ";
                    //do only if United States and not for international zip codes
                    if (RadiusDropPanel.Visible)
                    {
                        resultsStr += " within " + RadiusDropDown.SelectedItem.Text;
                        //Get all zips within the specified radius

                        if (int.TryParse(ZipTextBox.Text.Trim(), out zipParam))
                        {
                            zip = GetAllZipsInRadius(false);
                        }
                        else
                        {
                            goOn = false;
                            message = "Zip code is not in the right format.";
                        }
                    }
                    else
                    {
                        zip = " AND A.Zip = @zip ";
                        zipParameter = ZipTextBox.Text.Trim();
                    }
                }
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:GroupSearch_OLD.aspx.cs

示例13: Page_Load


//.........这里部分代码省略.........
                HtmlMeta lg = new HtmlMeta();
                HtmlLink cn = new HtmlLink();
                HtmlHead head = (HtmlHead)Page.Header;

                cn.Attributes.Add("rel", "canonical");
                cn.Href = "http://" + Request.Url.Authority + "/" +
                    dat.MakeNiceName(ds.Tables[0].Rows[0]["Header"].ToString()) +
                    "_" + ID.ToString() + "_Ad";
                head.Controls.AddAt(0, cn);

                kw.Name = "keywords";
                hm.Name = "Description";

                lg.Name = "language";
                lg.Content = "English";
                head.Controls.AddAt(0, lg);

                char [] delimeter = {' '};
                string[] keywords = dat.MakeNiceNameFull(ds.Tables[0].Rows[0]["Header"].ToString()).Replace("-", " ").Split(delimeter, StringSplitOptions.RemoveEmptyEntries);
                int count = 0;
                foreach (string token in keywords)
                {
                    if (count < 16)
                    {
                        if (kw.Content != "")
                            kw.Content += " ";
                        kw.Content += token;

                        count++;
                    }
                }
                head.Controls.AddAt(0, kw);

                hm.Content = dat.MakeNiceNameFull(dat.stripHTML(ds.Tables[0].Rows[0]["Description"].ToString()).Replace("   ", " ").Replace("  ", " ")).Replace("-", " ");
                if (hm.Content.Length > 200)
                    hm.Content = hm.Content.Substring(0, 197) + "...";

                head.Controls.AddAt(0, hm);

                this.Title = kw.Content;

                HtmlLink lk = new HtmlLink();
                lk.Href = "http://" + Request.Url.Authority + "/" + dat.MakeNiceName(dat.BreakUpString(ds.Tables[0].Rows[0]["Header"].ToString(), 14)) + "_" + ID.ToString() + "_Ad";
                lk.Attributes.Add("rel", "bookmark");
                head.Controls.AddAt(0, lk);
                #endregion

                DataView dvCats = dat.GetDataDV("SELECT DISTINCT C.ID, ACM.ID AS AID, C.Name AS CategoryName, ACM.tagSize FROM Ad_Category_Mapping ACM, AdCategories C WHERE ACM.CategoryID=C.ID AND ACM.AdID=" + ID + " ORDER BY ACM.ID");

                string justCats = "";

                for (int i = 0; i < dvCats.Count; i++)
                {
                    //kw.Content += ", " + dvCats[i]["CategoryName"].ToString();
                    justCats += dvCats[i]["CategoryName"].ToString() + " ";
                }

               // DiggLiteral.Text = " <table> " +
               //     "<tr>" +
               //       "  <td valign=\"bottom\" style=\"padding-right: 10px;\">" +
               //        "     <a name=\"fb_share\" type=\"button\" href=\"http://www.facebook.com/sharer.php\">Share</a><script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" type=\"text/javascript\"></script>" +
               //        " </td>" +
               //        " <td valign=\"bottom\" style=\"padding-right: 10px;\">" +
               //        "     <a style=\"border: 0; padding: 0; margin: 0;\" id=\"TweeterA\" title=\"Click to send this page to Twitter!\" target=\"_blank\" rel=\"nofollow\"><img style=\"border: 0; padding: 0; margin: 0;\" src=\"http://twitter-badges.s3.amazonaws.com/twitter-a.png\" alt=\"Share on Twitter\"/></a>" +
               //        " </td>" +
               //        " <td valign=\"bottom\" style=\"padding-right: 10px;\">" +
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:67,代码来源:Ad.aspx.cs

示例14: MakeItSo

    protected void MakeItSo(object sender, EventArgs e)
    {
        MessageLabel.Text = "";
        HttpCookie cookie = Request.Cookies["BrowserDate"];

        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);
        EmailTextBox.Text = dat.stripHTML(EmailTextBox.Text.Trim());
        ConfirmEmailTextBox.Text = dat.stripHTML(ConfirmEmailTextBox.Text.Trim());

        if (EmailTextBox.Text != "" && ConfirmEmailTextBox.Text != "")
        {
            bool safeToGo = true;

                if (dat.ValidateEmail(EmailTextBox.Text))
                {
                    if (safeToGo)
                    {
                        if (dat.TrapKey(EmailTextBox.Text, 2))
                        {
                            if (EmailTextBox.Text == ConfirmEmailTextBox.Text)
                                safeToGo = true;
                            else
                            {
                                MessageLabel.Text = "*Comfirmation Email must match the Email text box.";
                                safeToGo = false;
                            }
                        }
                        else
                        {
                            MessageLabel.Text = "*The Email must only contain allowed characters.";
                            safeToGo = false;
                        }

                        if (safeToGo)
                        {
                            DataSet dsEmail = dat.GetData("SELECT * FROM Users WHERE Email='"+EmailTextBox.Text+"'");

                            if (dsEmail.Tables.Count > 0)
                                if (dsEmail.Tables[0].Rows.Count > 0)
                                    safeToGo = false;

                            if (safeToGo)
                            {

                                if (TermsCheckBox.Checked)
                                {
                                    Encryption encrypt = new Encryption();

                                    dat.SendEmailNoFrills(System.Configuration.ConfigurationManager.AppSettings["emailemail"].ToString(),
                                        System.Configuration.ConfigurationManager.AppSettings["emailName"].ToString(), EmailTextBox.Text,
                                        "Hello From Hippo Happenings! <br/><br/> You have requested to create a Hippo Happenings account. We'd like to say, " +
                                        " GREAT CHOICE! <br/><br/> Please visit <a href=\"http://HippoHappenings.com/complete-registration?ID=" +
                                        encrypt.encrypt(EmailTextBox.Text) + "\">this link</a> to complete the creation of your account. ", "Hippo Happenings User Account Request");

                                    MessageRadWindow.NavigateUrl = "Message.aspx?message=" +
                                        encrypt.encrypt("An email has been sent to your address. "+
                                        "Please make sure to check your <b>JUNK MAIL</b> and your " +
                                        " inbox for further instruction to complete " +
                                        "your registration." +
                                        "<br/><br/><div align=\"center\">" +
                                        "<div style=\"width: 50px;\" onclick=\"Search('home')\">" +
                                        "<div class=\"topDiv\" style=\"clear: both;\">" +
                                          "  <img style=\"float: left;\" src=\"NewImages/ButtonLeft.png\" height=\"27px\" /> " +
                                           " <div class=\"NavyLink\" style=\"font-size: 12px; text-decoration: none; padding-top: 5px;padding-left: 6px; padding-right: 6px;height: 27px;float: left;background: url('NewImages/ButtonPixel.png'); background-repeat: repeat-x;\">" +
                                               " Ok " +
                                            "</div>" +
                                           " <img style=\"float: left;\" src=\"NewImages/ButtonRight.png\" height=\"27px\" /> " +
                                        "</div>" +
                                        "</div>" +
                                        "</div><br/>");
                                    MessageRadWindow.Visible = true;
                                    MessageRadWindowManager.VisibleOnPageLoad = true;
                                    MessageLabel.Text = "";
                                }
                                else
                                {
                                    MessageLabel.Text = "*You must agree to the terms and contidions.";
                                }
                            }
                            else
                            {
                                MessageLabel.Text = "An account for this email address already exists. If you believe this is your account "+
                                    "and you have forgot your password, go to <a href=\"login\">login page</a> and click on the 'forgot password' link.";
                            }
                        }
                    }
                }
                else
                    MessageLabel.Text = "Email is not valid";

        }
        else
            MessageLabel.Text = "*All fields must be filled in.";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:99,代码来源:Register.aspx.cs

示例15: OnwardsIT

    protected bool OnwardsIT(bool changeTab, int selectedIndex)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];

            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
            conn.Open();
            string message = "";

            switch (selectedIndex)
            {
                case 0:
                    #region Case 0

                    bool goOn = false;

                    bool isInternational = false;
                    string locationStr = "";

                    VenueNameTextBox.THE_TEXT = dat.stripHTML(VenueNameTextBox.THE_TEXT);
                    DescriptionTextBox.Content = dat.StripHTML_LeaveLinks(DescriptionTextBox.Content.Replace("<div>", "<br/>").Replace("</div>", ""));

                    if (VenueNameTextBox.THE_TEXT.Trim() != "" && DescriptionTextBox.Text.Trim() != "")
                    {
                        bool isUpdate = false;
                        if (Request.QueryString["ID"] != null)
                        {
                            isUpdate = true;
                        }

                        if (DescriptionTextBox.Text.Length <= 420)
                        {
                            if (VenueNameTextBox.THE_TEXT.Trim().Length <= 70)
                            {
                                if (changeTab)
                                    ChangeSelectedTab(0, 1);

                                return true;
                            }
                            else
                            {
                                MessagePanel.Visible = true;
                                YourMessagesLabel.Text += "<br/><br/>*Group Name be under 70 characters.";
                            }
                        }
                        else
                        {
                            MessagePanel.Visible = true;
                            YourMessagesLabel.Text += "<br/><br/>*Description must be under 420 characters.";
                        }

                    }
                    else
                    {
                        MessagePanel.Visible = true;
                        YourMessagesLabel.Text += "<br/><br/>*Please fill in all required fields.";
                    }
                    return false;
                    #endregion
                    break;
                case 1:

                    bool goon = true;
                    HostInstructions.Content = dat.StripHTML_LeaveLinks(HostInstructions.Content.Replace("<div>", "<br/>").Replace("</div>", ""));
                    if (HostInstructions.Text.Length > 300)
                    {
                        message = "Host's instructions must be less than 300 characters.";
                        goon = false;
                    }

                    if (goon)
                    {
                        CityTextBox.Text = dat.stripHTML(CityTextBox.Text);
                        ZipTextBox.Text = dat.stripHTML(ZipTextBox.Text);
                        LocationTextBox.Text = dat.stripHTML(LocationTextBox.Text.Trim());
                        PhoneTextBox.Text = dat.stripHTML(PhoneTextBox.Text.Trim());
                        EmailTextBox.Text = dat.stripHTML(EmailTextBox.Text.Trim());
                        WebSiteTextBox.Text = dat.stripHTML(WebSiteTextBox.Text.Trim());
                        string state = "";
                        if (StateTextBox.Visible)
                            state = dat.stripHTML(StateTextBox.THE_TEXT.Trim());
                        else
                        {
                            if (StateDropDown.SelectedValue != "-1")
                                state = StateDropDown.SelectedItem.Text;
                        }

                        if (state == "" || CityTextBox.Text.Trim() == "")
                        {
                            goon = false;
                            message = "Group Head-Quarter location must be included.";
                        }

                        if (goon)
                        {
                            if (StreetNumberTextBox.Text.Trim() != "" || StreetNameTextBox.Text.Trim() != "")
                            {
                                if (StreetNameTextBox.Text.Trim() == "" || StreetNameTextBox.Text.Trim() == ""
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:EnterGroup_OLD.aspx.cs


注:本文中的Data.stripHTML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。