Hello,
I am needing to put an href of href=\http://pcsoweb.com/ into the following code. I am getting a page not found with the local. The data resides on the link provided in the first sentence.. I have tried in several areas, but it still wants to go to the local source. Any help would be great.
da = new SqlDataAdapter("select top 6 bg.ItemID as ItemID,bc.CategoryID as CategoryID,c.Category as Category,bg.Heading as Heading,bg.Description as Description,bg.ItemUrl as ItemUrl,bg.SubTitle as SubTitle from mp_Blogs bg left Outer join mp_BlogItemCategories bc on bg.ItemID = bc.ItemID left Outer join mp_BlogCategories c on bc.CategoryID = c.CategoryID where IsPublished = 1 order by Abs(bg.ItemID) Desc", conn);
dt = new DataTable();
if (conn.State == ConnectionState.Open)
{
conn.Close();
}
conn.Open();
da.Fill(dt);
ltNews.Text += "<div id=\"cont-1-1\" class=\"tabcontent\">";
foreach (DataRow row in dt.Rows)
{
if (i % 2 == 1)
{
ltNews.Text += "<div class=\"tabbing-row1\">";
ltNews.Text += "<div class=\"tabbing-row1-left\">";
ltNews.Text += "<a title=\"\" href=" + Convert.ToString(row["ItemUrl"]).Replace("~", "") + ">";
if (Convert.ToString(row["Category"]) != "")
{
//ltNews.Text += "<a href=/" + Convert.ToString(row["Url"]) + "\">";
ltNews.Text += "<img alt=\"\" src=\"/Data/Sites/1/media/NewsRelease/" + Convert.ToString(row["Category"]).Trim().Replace(" ", "-") + ".png\" title=\"\" />";
ltNews.Text += "</a>";
}
else
{
ltNews.Text += "<img alt=\"\" src=\"/Soweb/d$/Virtual Web/Data/Sites/1/media/NewsRelease/ImgNotFound.png\" title=\"\" />";
ltNews.Text += "</a>";
}
ltNews.Text += "<span>";
ltNews.Text += "<a title=\"\" href=" + Convert.ToString(row["ItemUrl"]).Replace("~", "") + ">";
ltNews.Text += SetTitleLenght(Convert.ToString(row["Heading"]));
ltNews.Text += "</a>";
ltNews.Text += "</span>";
ltNews.Text += "<strong>";
ltNews.Text += "<a title=\"\" href=" + Convert.ToString(row["ItemUrl"]).Replace("~", "") + ">";
ltNews.Text += SetAttributeLenght(Convert.ToString(row["SubTitle"]));
ltNews.Text += "</a>";
ltNews.Text += "</strong>";
//ltNews.Text += "</a>";
ltNews.Text += "</div>";
}
else
{
ltNews.Text += "<div class=\"tabbing-row1-right\">";
//ltNews.Text += "<a title=\"\" href=\"#\">";
ltNews.Text += "<a title=\"\" href=" + Convert.ToString(row["ItemUrl"]).Replace("~", "") + ">";
if (Convert.ToString(row["Category"]) != "")
{
ltNews.Text += "<img alt=\"\" src=\"/Data/Sites/1/media/NewsRelease/" + Convert.ToString(row["Category"]).Trim().Replace(" ", "-") + ".png\" title=\"\" />";
ltNews.Text += "</a>";
}
else
{
ltNews.Text += "<img alt=\"\" src=\"/Data/Sites/1/media/NewsRelease/ImgNotFound.png\" title=\"\" />";
ltNews.Text += "</a>";
}
ltNews.Text += "<span>";
ltNews.Text += "<a title=\"\" href=" + Convert.ToString(row["ItemUrl"]).Replace("~", "") + ">";
ltNews.Text += SetTitleLenght(Convert.ToString(row["Heading"]));
ltNews.Text += "</a>";
ltNews.Text += "</span>";
ltNews.Text += "<strong>";
ltNews.Text += "<a title=\"\" href=" + Convert.ToString(row["ItemUrl"]).Replace("~", "") + ">";
ltNews.Text += SetAttributeLenght(Convert.ToString(row["SubTitle"]));
ltNews.Text += "</a>";
ltNews.Text += "</strong>";
//ltNews.Text += "</a>";
ltNews.Text += "</div>";
ltNews.Text += "</div>";
}
i++;
}
if (i % 2 == 0)
{
ltNews.Text += "</div>";
}
ltNews.Text += "</div>";
ltNews.Text += "<a target='_blank' style=\"color: #800000; margin:0 0 0 10px; float:right; \" href=\"http://pcsoweb.com/news-releases\">View All News Releases...</a>";
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
//catch (Exception ex)
}
Thank you,
Robert