Friday, August 6, 2010

Calling Css from code behind

private void CssSelect()
{
if (Request.QueryString["Id"] == "2")
{
lnk2.Attributes.Add("class", "selected");
}
else if (Request.QueryString["Id"] == "3")
{
lnk3.Attributes.Add("class", "selected");
}
else if (Request.QueryString["Id"] == "4")
{
lnk4.Attributes.Add("class", "selected");
}
else if (Request.QueryString["Id"] == "5")
{
lnk5.Attributes.Add("class", "selected");
}
else
{
lnk1.Attributes.Add("class", "selected");
}
}

No comments: