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


C# Data.FindControlRecursive方法代码示例

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


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

示例1: ChangeCheckImage

    protected void ChangeCheckImage(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        ImageButton CheckImageButton = (ImageButton)dat.FindControlRecursive(this, "CheckImageButton");

        if (CheckImageButton.ImageUrl == "image/Check.png")
            CheckImageButton.ImageUrl = "image/CheckSelected.png";
        else
        {
            CheckImageButton.ImageUrl = "image/Check.png";
            CheckBoxList CategoriesCheckBoxes = (CheckBoxList)dat.FindControlRecursive(this, "CategoriesCheckBoxes");
            for (int i = 0; i < CategoriesCheckBoxes.Items.Count; i++)
                CategoriesCheckBoxes.Items[i].Selected = false;
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:16,代码来源:VenueSearch.aspx.cs

示例2: ChangeImage2

    protected void ChangeImage2(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        ImageButton ImageButton2 = (ImageButton)dat.FindControlRecursive(this, "ImageButton2");
        ImageButton ImageButton1 = (ImageButton)dat.FindControlRecursive(this, "ImageButton1");

        if (ImageButton2.ImageUrl == "image/RadioButton.png")
        {
            ImageButton2.ImageUrl = "image/RadioButtonSelected.png";
            ImageButton1.ImageUrl = "image/RadioButton.png";
        }
        else
        {
            ImageButton2.ImageUrl = "image/RadioButton.png";
            ImageButton1.ImageUrl = "image/RadioButton.png";
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:18,代码来源:GroupSearch_OLD.aspx.cs

示例3: ChangeCheckImage

    protected void ChangeCheckImage(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        ImageButton CheckImageButton = (ImageButton)dat.FindControlRecursive(this, "CheckImageButton");

        if (CheckImageButton.ImageUrl == "image/Check.png")
            CheckImageButton.ImageUrl = "image/CheckSelected.png";
        else
            CheckImageButton.ImageUrl = "image/Check.png";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:11,代码来源:CompleteRegistration.aspx.cs

示例4: AddTo

    protected void AddTo(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        string userID = "";
        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
        {
            authTicket = FormsAuthentication.Decrypt(authCookie.Value);
            string group = authTicket.UserData.ToString();

            if (group.Contains("User"))
            {
                userID = authTicket.Name;
            }
            else
            {
                Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                calendarLink.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }

        dat.Execute("INSERT INTO User_Calendar (UserID, EventID, ExcitmentID, isConnect, DateAdded) VALUES(" + userID + ", " +
            Session["EventID"].ToString() + ", " + EventExcitmentDropDown.SelectedValue + ", '" +
            ConnectCheckBox.Checked.ToString() + "', '" + DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")).ToString() + "')");

        Label label = (Label)dat.FindControlRecursive(this.Parent, "AddToLabel");
        LinkButton link = (LinkButton)dat.FindControlRecursive(this.Parent, "AddToLink");
        label.Text = "stufrf";
        label.Visible = true;
        link.Visible = false;

        dat.SendFriendAddNotification(Session["User"].ToString(), ID);
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:39,代码来源:MessageAlert.aspx.cs

示例5: Page_Load

    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", ":")));
        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("Admin"))
            {
                if (group.Contains("User"))
                {
                    Session["User"] = authTicket.Name;
                    Session["UserName"] = dat.GetData("SELECT UserName FROM USERS WHERE User_ID="+authTicket.Name).Tables[0].Rows[0]["UserName"].ToString();
                    if(!IsPostBack)
                        SetPoll();
                }
                else
                {
                    if(!IsPostBack)
                        SetNotAnsweredPoll();
                }
            }
            else
            {
                ImageButton calendarLink = (ImageButton)dat.FindControlRecursive(this, "CalendarLink");
                calendarLink.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:49,代码来源:AnswerPoll.aspx.cs

示例6: Page_Init

    protected void Page_Init(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", ":")));

        Button button = (Button)dat.FindControlRecursive(this, "AdsLink");
        button.CssClass = "NavBarImageAdSelected";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:15,代码来源:AdsAndClassifieds.aspx.cs

示例7: ChangeCheckImage

    protected void ChangeCheckImage(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", ":")));
        ImageButton CheckImageButton = (ImageButton)dat.FindControlRecursive(this, "CheckImageButton");

        if (CheckImageButton.ImageUrl == "image/Check.png")
            CheckImageButton.ImageUrl = "image/CheckSelected.png";
        else
            CheckImageButton.ImageUrl = "image/Check.png";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:18,代码来源:Register.aspx.cs

示例8: FriendSearch

    protected void FriendSearch(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        ClearMessage();
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        TextBox FriendSearchTextBox = (TextBox)dat.FindControlRecursive(this, "FriendSearchTextBox");

        Label FriendMessageLabel = (Label)dat.FindControlRecursive(this, "FriendMessageLabel");

        if (FriendSearchTextBox.Text != "" && dat.TrapKey(FriendSearchTextBox.Text, 1))
        {
            DataSet ds = dat.GetData("SELECT * FROM Users WHERE UserName LIKE '%" + FriendSearchTextBox.Text + "%'");

            if (ds.Tables.Count > 0)
                if (ds.Tables[0].Rows.Count > 0)
                {
                    FillSearchPanel(ds);
                    ViewState["FriendDS"] = ds;
                }
                else
                    FriendMessageLabel.Text = "0 Results Found.";
            else
                FriendMessageLabel.Text = "0 Results Found.";
        }
        else
            FriendMessageLabel.Text = "Include a valid User Name in the text field.";
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:28,代码来源:User.aspx.cs

示例9: AddToVenue

    protected void AddToVenue(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        string userID = "";
        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
        {
            authTicket = FormsAuthentication.Decrypt(authCookie.Value);
            string group = authTicket.UserData.ToString();

            if (group.Contains("User"))
            {
                userID = authTicket.Name;
            }
            else
            {
                Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                calendarLink.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }

        dat.Execute("INSERT INTO UserVenues (UserID, VenueID) VALUES(" + userID + ", " + Session["VenueID"].ToString()+")");
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:29,代码来源:Copy+of+MessageAlert.aspx.cs

示例10: SendIt

    protected void SendIt(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        string userID = "";
        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
        {
            authTicket = FormsAuthentication.Decrypt(authCookie.Value);
            string group = authTicket.UserData.ToString();

            if (group.Contains("User"))
            {
                userID = authTicket.Name;
            }
            else
            {
                Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                calendarLink.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }

        string toUserID = Session["ViewedUser"].ToString();

        string subject = "";

        if (Session["Subject"].ToString() == "")
            subject = SubjectTextBox.Text;
        else
            subject = Session["Subject"].ToString();

        if (subject != "")
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());

            conn.Open();
            SqlCommand cmd = new SqlCommand("INSERT INTO UserMessages (MessageContent, MessageSubject, From_UserID, To_UserID, Date, [Read], Mode)"
                + " VALUES(@content, @subject, @fromID, @toID, @date, 'False', 0)", conn);
            cmd.Parameters.Add("@content", SqlDbType.Text).Value = MessageTextBox.Text;
            cmd.Parameters.Add("@subject", SqlDbType.NVarChar).Value = subject;
            cmd.Parameters.Add("@toID", SqlDbType.Int).Value = int.Parse(toUserID);
            cmd.Parameters.Add("@fromID", SqlDbType.Int).Value = int.Parse(userID);
            cmd.Parameters.Add("@date", SqlDbType.DateTime).Value = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
            cmd.ExecuteNonQuery();
            conn.Close();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:52,代码来源:Copy+of+MessageAlert.aspx.cs

示例11: ServerReply

    protected void ServerReply(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        bool goOn = false;

        if (Session["NotFinished"] == null)
        {
            Session["NotFinished"] = true;
            if (Session["TimeReplySubmitted"] == null)
                goOn = true;
            else
            {
                if (DateTime.Now < ((DateTime)Session["TimeReplySubmitted"]).AddSeconds(2))
                {
                    goOn = false;
                }
                else
                {
                    goOn = true;
                }
            }

            if (goOn)
            {
                try
                {
                    Session["TimeReplySubmitted"] = DateTime.Now;

                    LinkButton link = (LinkButton)sender;
                    string[] delim = { "reply" };

                    string[] tokens = link.CommandArgument.Split(delim, StringSplitOptions.None);

                    TextBox textbox = (TextBox)dat.FindControlRecursive(this, tokens[0] + "textbox" + tokens[1]);

                    Panel panel = (Panel)dat.FindControlRecursive(this, "RadPanel" + tokens[1]);

                    int To_ID = int.Parse(tokens[0]);

                    DataSet ds = dat.GetData("SELECT * FROM UserMessages WHERE ID=" + tokens[1]);

                    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());

                    conn.Open();
                    SqlCommand cmd = new SqlCommand("INSERT INTO UserMessages (MessageContent, MessageSubject, " +
                        "From_UserID, To_UserID, Date, [Read], Mode)"
                        + " VALUES(@content, @subject, @fromID, @toID, @date, 'False', 0)", conn);
                    cmd.Parameters.Add("@content", SqlDbType.Text).Value = textbox.Text;
                    cmd.Parameters.Add("@subject", SqlDbType.NVarChar).Value = "Re: " + ds.Tables[0].Rows[0]["MessageSubject"].ToString();
                    cmd.Parameters.Add("@toID", SqlDbType.Int).Value = To_ID;
                    cmd.Parameters.Add("@fromID", SqlDbType.Int).Value = Session["User"].ToString();
                    cmd.Parameters.Add("@date", SqlDbType.DateTime).Value = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
                    cmd.ExecuteNonQuery();

                    DataSet dsUser = dat.GetData("SELECT * FROM Users WHERE User_ID=" + Session["User"].ToString());
                    DataSet dsTo = dat.GetData("SELECT * FROM Users U, UserPreferences UP WHERE UP.UserID=U.User_ID AND U.User_ID=" + To_ID);

                    //only send to email if users preferences are set to do so.
                    if (dsTo.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("4"))
                    {
                        dat.SendEmail(System.Configuration.ConfigurationManager.AppSettings["emailemail"],
                            System.Configuration.ConfigurationManager.AppSettings["emailName"],
                            dsTo.Tables[0].Rows[0]["Email"].ToString(), textbox.Text, "Re: " + ds.Tables[0].Rows[0]["MessageSubject"].ToString());
                    }
                    conn.Close();

                    Literal lit = new Literal();
                    lit.Text = "<div align=\"left\" style=\"width: 220px; margin: 5px; float: right;\" class=\"Green12LinkNF\">Your reply has been sent!</div>";

                    panel.Controls.AddAt(7, lit);

                    Session["NotFinished"] = null;
                    Session.Remove("NotFinished");
                }
                catch (Exception ex)
                {
                    MessagesErrorLabel.Text += " " + ex.ToString();

                    Session["NotFinished"] = null;
                    Session.Remove("NotFinished");
                }
            }
            else
            {
                LinkButton link = (LinkButton)sender;
                string[] delim = { "reply" };

                string[] tokens = link.CommandArgument.Split(delim, StringSplitOptions.None);

                Panel panel = (Panel)dat.FindControlRecursive(this, "RadPanel" + tokens[1]);

                Literal lit = new Literal();
                lit.Text = "<div align=\"left\" style=\"height: 30px; width: 220px; margin: 5px; float: right;\" class=\"Green12LinkNF\">Your reply has been sent!</div>";

                panel.Controls.AddAt(7, lit);

                Session["NotFinished"] = null;
                Session.Remove("NotFinished");
            }
//.........这里部分代码省略.........
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:101,代码来源:User.aspx.cs

示例12: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        SummaryTextBox.Attributes.Add("onkeyup", "CountChars()");

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

        HtmlMeta kw = new HtmlMeta();
        kw.Name = "keywords";
        kw.Content = "post local ad in your neighborhood for your community interest groups";

        head.Controls.AddAt(0, kw);

        HtmlMeta hm = new HtmlMeta();
        hm.Name = "description";
        hm.Content = "Post local ads in your neighborhood which will be posted in your community and interest groups";

        head.Controls.AddAt(0, hm);

        lk = new HtmlLink();
        lk.Href = "http://" + Request.Url.Authority + "/PostAnAd.aspx";
        lk.Attributes.Add("rel", "bookmark");
        head.Controls.AddAt(0, lk);

        try
        {
            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);
            }
            StartDateTimePicker.MinDate = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")).Subtract(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")).TimeOfDay);
            Session["RedirectTo"] = Request.Url.AbsoluteUri;
            if (!IsPostBack)
            {
                Session["UserAvailableDate"] = null;
                Session.Remove("UserAvailableDate");
                Session["RedirectTo"] = "PostAnAd.aspx";
                Session["categorySession"] = null;

            }

            if (Session["UserAvailableDate"] != null)
            {
                bool isBig = false;
                if (AdPlacementList.SelectedValue == "0.04")
                    isBig = true;
                //GetAvailableUsers((DateTime)Session["UserAvailableDate"], isBig);
            }

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

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

            DataView dv = dat.GetDataDV("SELECT * FROM TermsAndConditions");
            Literal lit1 = new Literal();
            lit1.Text = "<div style=\"padding-bottom: 20px;\">"+dv[0]["Content"].ToString()+"</div>";
            TACTextBox.Controls.Add(lit1);

            if (Session["User"] != null)
            {
                LoggedInPanel.Visible = true;
            }
            else
            {
                WelcomeLabel.Text = "HippoHappenings's delivers content for users by users. " +
                "You have all the power to post events, advertisements and venues. " +
                "Users are responsible for all posted content, so mind " +
                "what you post. Everyone has the power to flag content deemed expressly " +
                "offensive, illegal or corporate in nature. In order to make this possible, " +
                "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. If you already have an account, <a class=\"AddLink\" href=\"UserLogin.aspx\">login</a> and post your ad!";
                //WelcomeLabel.Text = "On Hippo Happenings, the users have all the power to post event, 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 throughout the site and much more. <br/><br/>So let's go <a class=\"AddLink\" style=\"font-size: 16px;\" href=\"Register.aspx\">Register!</a>";
            }

            try
            {
                if (!IsPostBack)
                {

                    DataSet dsCountry = dat.GetData("SELECT * FROM Countries");
                    CountryDropDown.DataSource = dsCountry;
                    CountryDropDown.DataTextField = "country_name";
                    CountryDropDown.DataValueField = "country_id";
                    CountryDropDown.DataBind();

                    CountryDropDown.SelectedValue = "223";

                    DataSet ds = dat.GetData("SELECT * FROM State WHERE country_id=223");

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

示例13: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Session["Type"] = "Venue";
        Session["VenueID"] = VenueID;
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        string cookieName = FormsAuthentication.FormsCookieName;
        HttpCookie authCookie = Context.Request.Cookies[cookieName];

        if (IsPostBack)
        {
            MessageRadWindowManager.VisibleOnPageLoad = false;
        }

        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();
            }
            else
            {
                Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                calendarLink.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }

        DataSet ds = dat.GetData("SELECT * FROM UserVenues WHERE UserID="+Session["User"].ToString() + " AND VenueID="+VenueID.ToString());

        if (ds.Tables.Count > 0)
            if (ds.Tables[0].Rows.Count > 0)
            {
                AddToLabel.Text = "This venue is one of your favorites";
                AddToLabel.CssClass = "AddLinkGoing";
                AddToLabel.Visible = true;
                ImagePanel.Visible = false;
            }
            else
            {
                AddToLink.Text = "Add this venue to my favorites";
                AddToLink.Visible = true;
                ImagePanel.Visible = true;
            }
        else
        {
            AddToLink.Text = "Add this venue to my favorites";
            AddToLink.Visible = true;
            ImagePanel.Visible = true;
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:63,代码来源:AddToFavorites.ascx.cs

示例14: Page_Init

    //protected void Search(object sender, EventArgs e)
    //{
    //    if (SearchTextBox.THE_TEXT != "")
    //    {
    //        char[] delim = { ' ' };
    //        string[] tokens;
    //        tokens = SearchTextBox.THE_TEXT.Split(delim);
    //        string temp = "";
    //        for (int i = 0; i < tokens.Length; i++)
    //        {
    //            temp += " E.Header LIKE @search" + i.ToString();
    //            if (i + 1 != tokens.Length)
    //                temp += " AND ";
    //        }
    //        string searchStr = "SELECT DISTINCT E.ID AS EID, V.ID AS VID, * FROM Events E, Venues V, Event_Occurance EO WHERE E.ID=EO.EventID AND E.Venue=V.ID AND " + temp;
    //        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
    //        if (conn.State != ConnectionState.Open)
    //            conn.Open();
    //        SqlCommand cmd = new SqlCommand(searchStr, conn);
    //        for (int i = 0; i < tokens.Length; i++)
    //        {
    //            cmd.Parameters.Add("@search" + i.ToString(), SqlDbType.NVarChar).Value = "%" + tokens[i] + "%";
    //        }
    //        DataSet ds = new DataSet();
    //        SqlDataAdapter da = new SqlDataAdapter(cmd);
    //        da.Fill(ds);
    //        conn.Close();
    //        Session["EventSearchDS"] = ds;
    //    }
    //    Response.Redirect("EventSearch.aspx");
    //}
    protected void Page_Init(object sender, EventArgs e)
    {
        try
        {
            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];

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

                    if (group.Contains("User"))
                    {
                        //DataSet ds2 = dat.RetrieveAds(Session["User"].ToString(), false);
                        //DataSet dsMain = dat.RetrieveMainAds(Session["User"].ToString());
                        //Ads1.DATA_SET = ds2;
                        //Ads1.MAIN_AD_DATA_SET = dsMain;
                    }
                    else
                    {
                        //Ads1.DATA_SET = dat.RetrieveAllAds(false);
                        //Ads1.MAIN_AD_DATA_SET = dat.RetrieveAllAds(true);
                    }
                }
                catch (Exception ex)
                {
                    //Response.Redirect("~/UserLogin.aspx");
                }
            }
            Button button = (Button)dat.FindControlRecursive(this, "HomeLink");
            button.CssClass = "NavBarImageHomeSelected";
        }
        catch (Exception ex)
        {
            ErrorLabel.Text = ex.ToString();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:85,代码来源:Home_OLD.aspx.cs

示例15: DoAll

    protected void DoAll()
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (Session["User"] != null)
        {
            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
            {
                authTicket = FormsAuthentication.Decrypt(authCookie.Value);
                string group = authTicket.UserData.ToString();

                if (group.Contains("User"))
                {
                    Session["User"] = authTicket.Name;
                    Session["UserName"] = dat.GetData("SELECT UserName FROM USERS WHERE User_ID=" + Session["User"].ToString()).Tables[0].Rows[0]["UserName"].ToString();
                }
                else
                {
                    Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                    calendarLink.Visible = false;
                    Response.Redirect("~/UserLogin.aspx");
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/UserLogin.aspx");
            }

            Session["UserName"] = dat.GetData("SELECT * FROM Users WHERE User_ID=" +
                Session["User"].ToString()).Tables[0].Rows[0]["UserName"].ToString();
            UserLabel.Text = Session["UserName"].ToString();
            ClearMessage();
            CalendarLink.NavigateUrl = "UserCalendar.aspx?ID=" + Session["User"].ToString();
            if (IsPostBack)
            {
                if (ViewState["FriendDS"] != null)
                    FillSearchPanel((DataSet)ViewState["FriendDS"]);
            }
            FillVenues();
            FillRecommendedEvents();

                LoadControlsNotAJAX();

            LoadFriends();

            LoadGlanceCalendar();
            FillGroups();
            //GetFriendEvents();

        }
        else
        {
            ErrorLabel.Text = "somtin happen";
            Response.Redirect("UserLogin.aspx");
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:60,代码来源:User_OLD.aspx.cs


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