コード例 #1
0
    private void MakeLinksText()
    {
        int          Vid = Convert.ToInt32(Request.QueryString["propertyID"]);
        DBConnection obj = new DBConnection();

        try
        {
            DataTable dt = VADBCommander.CityStateCountryByProperty(Vid.ToString());
            if (dt.Rows.Count > 0)
            {
                city    = dt.Rows[0]["City"].ToString();
                state   = dt.Rows[0]["State"].ToString();
                country = dt.Rows[0]["Country"].ToString();

                string temp = CommonFunctions.GetSiteAddress() + "/" + dt.Rows[0]["Country"].ToString() + "/" + dt.Rows[0]["State"].ToString() + "/" + dt.Rows[0]["City"].ToString() + "/default.aspx";
                temp = temp.ToLower();
                temp = temp.Replace(" ", "_");

                hlkCity.Text        = city;
                hlkCity.NavigateUrl = temp;

                temp                 = CommonFunctions.GetSiteAddress() + "/" + dt.Rows[0]["Country"].ToString() + "/" + dt.Rows[0]["State"].ToString() + "/default.aspx";
                temp                 = temp.ToLower();
                temp                 = temp.Replace(" ", "_");
                hlkState.Text        = state;
                hlkState.NavigateUrl = temp;

                temp                   = CommonFunctions.GetSiteAddress() + "/" + dt.Rows[0]["Country"].ToString() + "/default.aspx";
                temp                   = temp.ToLower();
                temp                   = temp.Replace(" ", "_");
                hlkCountry.Text        = country;
                hlkCountry.NavigateUrl = temp;


                temp                    = CommonFunctions.GetSiteAddress() + "/" + dt.Rows[0]["Country"].ToString() + "/" + dt.Rows[0]["State"].ToString() + "/" + dt.Rows[0]["City"].ToString() + "/" + Vid.ToString() + "/default.aspx";
                temp                    = temp.ToLower();
                temp                    = temp.Replace(" ", "_");
                hlkProperty.Text        = "Property #" + Vid.ToString();
                hlkProperty.NavigateUrl = temp;

                Session["calCity"] = dt.Rows[0]["City"].ToString();
            }
        }
        catch (Exception ex) { lblInfo.Text = ex.Message; }
        finally { obj.CloseConnection(); }
        Page.Header.Controls.Add(new LiteralControl("<link href='/css/StyleSheetBig4.css' rel='stylesheet' type='text/css'></script>"));
    }